gcc/gcc/optabs.c

8632 lines
257 KiB
C
Raw Normal View History

1991-12-30 04:19:53 +01:00
/* Expand the basic unary and binary arithmetic operations, for GNU compiler.
Copyright (C) 1987-2015 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 3, or (at your option) any later
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
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
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
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"
#include "coretypes.h"
tree-core.h: Include symtab.h. 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * tree-core.h: Include symtab.h. * rtl.h: Include hard-reg-set.h but not flags.h. (HARD_CONST): Remove condition compilation involving HARD_CONST since hard-reg-set.h is always included. * regs.h: Don't include hard-reg-set.h or rtl.h. * cfg.h: Include dominance.h. * gimple.h: Include tree-ssa-alias.h and gimple-expr.h. * backend.h: New. Aggregate commonly used backend header files. * gimple-ssa.h: Don't include tree-hasher.h. * ssa.h: New. Aggregate commonly used SSA header files. * regset.h: Remove bitmap.h and hard-reg-set.h #includes. * sel-sched-ir.h: Flatten includes. * lra-int.h: Flatten completely. * sel-sched-dump.h: Flatten includes. * ira-int.h: Flatten includes. * gimple-streamer.h: Remove all includes. * cfgloop.h: Remove all #includes except cfgloopmanip.h. * resource.h: Flatten hard-reg-set.h and df.h. * sched-int.h: Flatten insn-arrt.h and df.h. * valtrack.h: flatten bitmap.h, df.h, and rtl.h * df.h: Flatten includes, leaving regset.h, alloc-pool.h and timevar.h. * genattrtab.c (write_header): Adjust generated includes. * genautomata.c (main): Likewise. * genconditions.c (write-header): Likewise. * genemit.c (main): Likewise. * gengtype.c (open_base_files): Likewise. * genopinit.c (main): Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c (main): Likewise. * genpreds.c (write_insn_preds_c): Likewise. * genrecog.c (write_header): Likewise. * alias.c: Adjust includes. * asan.c: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * auto-profile.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * ccmp.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * cfgloopanal.c: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraphbuild.c: Likewise. * cgraphclones.c: Likewise. * cgraphunit.c: Likewise. * cilk-common.c: Likewise. * combine-stack-adj.c: Likewise. * combine.c: Likewise. * compare-elim.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * cppbuiltin.c: Likewise. * cprop.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * data-streamer-in.c: Likewise. * data-streamer-out.c: Likewise. * data-streamer.c: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * debug.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dojump.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * dse.c: Likewise. * dumpfile.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2cfi.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * fwprop.c: Likewise. * gcc-plugin.h: Likewise. * gcse-common.c: Likewise. * gcse.c: Likewise. * generic-match-head.c: Likewise. * ggc-page.c: Likewise. * gimple-builder.c: Likewise. * gimple-expr.c: Likewise. * gimple-fold.c: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-match-head.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple-ssa-isolate-paths.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimple-streamer-in.c: Likewise. * gimple-streamer-out.c: Likewise. * gimple-walk.c: Likewise. * gimple.c: Likewise. * gimplify-me.c: Likewise. * gimplify.c: Likewise. * godump.c: Likewise. * graph.c: Likewise. * graphite-blocking.c: Likewise. * graphite-dependences.c: Likewise. * graphite-interchange.c: Likewise. * graphite-isl-ast-to-gimple.c: Likewise. * graphite-optimize-isl.c: Likewise. * graphite-poly.c: Likewise. * graphite-scop-detection.c: Likewise. * graphite-sese-to-poly.c: Likewise. * graphite.c: Likewise. * haifa-sched.c: Likewise. * hw-doloop.c: Likewise. * ifcvt.c: Likewise. * init-regs.c: Likewise. * internal-fn.c: Likewise. * ipa-chkp.c: Likewise. * ipa-comdats.c: Likewise. * ipa-cp.c: Likewise. * ipa-devirt.c: Likewise. * ipa-icf-gimple.c: Likewise. * ipa-icf.c: Likewise. * ipa-inline-analysis.c: Likewise. * ipa-inline-transform.c: Likewise. * ipa-inline.c: Likewise. * ipa-polymorphic-call.c: Likewise. * ipa-profile.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-ref.c: Likewise. * ipa-reference.c: Likewise. * ipa-split.c: Likewise. * ipa-utils.c: Likewise. * ipa-visibility.c: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lra-assigns.c: Likewise. * lra-coalesce.c: Likewise. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * lra-spills.c: Likewise. * lra.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * opts-global.c: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * realmpfr.c: Likewise. * recog.c: Likewise. * ree.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regrename.c: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl-chkp.c: Likewise. * rtlanal.c: Likewise. * rtlhooks.c: Likewise. * sanopt.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * sel-sched.c: Likewise. * sese.c: Likewise. * shrink-wrap.c: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * symtab.c: Likewise. * target-globals.c: Likewise. * targhooks.c: Likewise. * toplev.c: Likewise. * tracer.c: Likewise. * trans-mem.c: Likewise. * tree-affine.c: Likewise. * tree-browser.c: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chkp-opt.c: Likewise. * tree-chkp.c: Likewise. * tree-chrec.c: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-dfa.c: Likewise. * tree-diagnostic.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-emutls.c: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-iterator.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-scopedtables.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-tail-merge.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-stdarg.c: Likewise. * tree-streamer-in.c: Likewise. * tree-streamer-out.c: Likewise. * tree-streamer.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tsan.c: Likewise. * ubsan.c: Likewise. * valtrack.c: Likewise. * value-prof.c: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vmsdbgout.c: Likewise. * vtable-verify.c: Likewise. * web.c: Likewise. * wide-int.cc: Likewise. * xcoffout.c: Likewise. * config/aarch64/aarch64-builtins.c: Likewise. * config/aarch64/aarch64.c: Likewise. * config/aarch64/cortex-a57-fma-steering.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/aarch-common.c: Likewise. * config/arm/arm-builtins.c: Likewise. * config/arm/arm-c.c: Likewise. * config/arm/arm.c: Likewise. * config/avr/avr-c.c: Likewise. * config/avr/avr-log.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/c6x/c6x.c: Likewise. * config/cr16/cr16.c: Likewise. * config/cris/cris.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/epiphany/epiphany.c: Likewise. * config/epiphany/mode-switch-use.c: Likewise. * config/epiphany/resolve-sw-modes.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/ft32/ft32.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386-c.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/msformat-c.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/microblaze/microblaze-c.c: Likewise. * config/microblaze/microblaze.c: Likewise. * config/mips/mips.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/msp430/msp430-c.c: Likewise. * config/msp430/msp430.c: Likewise. * config/nds32/nds32-cost.c: Likewise. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/nios2/nios2.c: Likewise. * config/nvptx/nvptx.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/rl78/rl78-c.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390-c.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh-c.c: Likewise. * config/sh/sh-mem.cc: Likewise. * config/sh/sh.c: Likewise. * config/sh/sh_optimize_sett_clrt.cc: Likewise. * config/sh/sh_treg_combine.cc: Likewise. * config/sol2-c.c: Likewise. * config/sol2-cxx.c: Likewise. * config/sol2-stubs.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc-c.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu-c.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/tilegx/mul-tables.c: Likewise. * config/tilegx/tilegx-c.c: Likewise. * config/tilegx/tilegx.c: Likewise. * config/tilepro/mul-tables.c: Likewise. * config/tilepro/tilepro-c.c: Likewise. * config/tilepro/tilepro.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/visium/visium.c: Likewise. * config/vms/vms-c.c: Likewise. * config/vms/vms.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. ada 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * gcc-interface/cuintp.c: Adjust includes. * gcc-interface/decl.c: Likewise. * gcc-interface/misc.c: Likewise. * gcc-interface/targtyps.c: Likewise. * gcc-interface/trans.c: Likewise. * gcc-interface/utils.c: Likewise. * gcc-interface/utils2.c: Likewise. c 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * c-array-notation.c: Adjust includes. * c-aux-info.c: Likewise. * c-convert.c: Likewise. * c-decl.c: Likewise. * c-errors.c: Likewise. * c-lang.c: Likewise. * c-objc-common.c: Likewise. * c-parser.c: Likewise. * c-typeck.c: Likewise. c-family 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * array-notation-common.c: Adjust includes. * c-ada-spec.c: Likewise. * c-cilkplus.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-dump.c: Likewise. * c-format.c: Likewise. * c-gimplify.c: Likewise. * c-indentation.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-pch.c: Likewise. * c-ppoutput.c: Likewise. * c-pragma.c: Likewise. * c-pretty-print.c: Likewise. * c-semantics.c: Likewise. * c-ubsan.c: Likewise. * cilk.c: Likewise. * stub-objc.c: Likewise. cp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * call.c: Adjust includes. * class.c: Likewise. * constexpr.c: Likewise. * cp-array-notation.c: Likewise. * cp-gimplify.c: Likewise. * cp-lang.c: Likewise. * cp-objcp-common.c: Likewise. * cp-ubsan.c: Likewise. * cvt.c: Likewise. * decl.c: Likewise. * decl2.c: Likewise. * dump.c: Likewise. * error.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * friend.c: Likewise. * init.c: Likewise. * lambda.c: Likewise. * lex.c: Likewise. * mangle.c: Likewise. * method.c: Likewise. * name-lookup.c: Likewise. * optimize.c: Likewise. * parser.c: Likewise. * pt.c: Likewise. * ptree.c: Likewise. * repo.c: Likewise. * rtti.c: Likewise. * search.c: Likewise. * semantics.c: Likewise. * tree.c: Likewise. * typeck.c: Likewise. * typeck2.c: Likewise. fortran 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * convert.c: Adjust includes. * cpp.c: Likewise. * decl.c: Likewise. * f95-lang.c: Likewise. * iresolve.c: Likewise. * match.c: Likewise. * module.c: Likewise. * options.c: Likewise. * target-memory.c: Likewise. * trans-array.c: Likewise. * trans-common.c: Likewise. * trans-const.c: Likewise. * trans-decl.c: Likewise. * trans-expr.c: Likewise. * trans-intrinsic.c: Likewise. * trans-io.c: Likewise. * trans-openmp.c: Likewise. * trans-stmt.c: Likewise. * trans-types.c: Likewise. * trans.c: Likewise. go 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * go-backend.c: Adjust includes. * go-gcc.cc: Likewise. * go-lang.c: Likewise. java 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * boehm.c: Adjust includes. * builtins.c: Likewise. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * java-gimplify.c: Likewise. * jcf-dump.c: Likewise. * jcf-io.c: Likewise. * jcf-parse.c: Likewise. * jvgenmain.c: Likewise. * lang.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. jit 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * dummy-frontend.c: Adjust includes. * jit-common.h: Likewise. * jit-playback.c: Likewise. lto 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * lto-lang.c: Adjust includes. * lto-object.c: Likewise. * lto-partition.c: Likewise. * lto-symtab.c: Likewise. * lto.c: Likewise. objc 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objc-act.c: Adjust includes. * objc-encoding.c: Likewise. * objc-gnu-runtime-abi-01.c: Likewise. * objc-lang.c: Likewise. * objc-map.c: Likewise. * objc-next-runtime-abi-01.c: Likewise. * objc-next-runtime-abi-02.c: Likewise. * objc-runtime-shared-support.c: Likewise. objcp 2015-07-07 Andrew MacLeod <amacleod@redhat.com> * objcp-decl.c: Adjust includes. * objcp-lang.c: Likewise. From-SVN: r225531
2015-07-08 02:53:03 +02:00
#include "backend.h"
toplev.h: Do not include diagnostic-core.h. 2010-07-08 Manuel López-Ibáñez <manu@gcc.gnu.org> * toplev.h: Do not include diagnostic-core.h. Include diagnostic-core.h in every file that includes toplev.h. * c-tree.h: Do not include toplev.h. * pretty-print.h: Update comment. * Makefile.in: Update dependencies. * alias.c: Include diagnostic-core.h in every file that includes toplev.h. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgbuild.c: Likewise. * cfgcleanup.c: Likewise. * cfghooks.c: Likewise. * cfgloop.c: Likewise. * combine.c: Likewise. * config/alpha/alpha.c: Likewise. * config/arc/arc.c: Likewise. * config/arm/arm.c: Likewise. * config/arm/pe.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/cris/cris.c: Likewise. * config/crx/crx.c: Likewise. * config/darwin-c.c: Likewise. * config/darwin.c: Likewise. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * config/h8300/h8300.c: Likewise. * config/host-darwin.c: Likewise. * config/i386/i386.c: Likewise. * config/i386/netware.c: Likewise. * config/i386/nwld.c: Likewise. * config/i386/winnt-cxx.c: Likewise. * config/i386/winnt-stubs.c: Likewise. * config/i386/winnt.c: Likewise. * config/ia64/ia64-c.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/lm32/lm32.c: Likewise. * config/m32c/m32c-pragma.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep-pragma.c: Likewise. * config/mep/mep.c: Likewise. * config/mmix/mmix.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/pdp11/pdp11.c: Likewise. * config/picochip/picochip.c: Likewise. * config/rs6000/rs6000-c.c: Likewise. * config/rs6000/rs6000.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/score/score.c: Likewise. * config/score/score3.c: Likewise. * config/score/score7.c: Likewise. * config/sh/sh.c: Likewise. * config/sh/symbian-base.c: Likewise. * config/sh/symbian-c.c: Likewise. * config/sh/symbian-cxx.c: Likewise. * config/sol2-c.c: Likewise. * config/sol2.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850-c.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/vxworks.c: Likewise. * config/xtensa/xtensa.c: Likewise. * convert.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbxout.c: Likewise. * ddg.c: Likewise. * dominance.c: Likewise. * emit-rtl.c: Likewise. * explow.c: Likewise. * expmed.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * fwprop.c: Likewise. * gcse.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * gimple-low.c: Likewise. * gimplify.c: Likewise. * graph.c: Likewise. * haifa-sched.c: Likewise. * ifcvt.c: Likewise. * implicit-zee.c: Likewise. * integrate.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-iv.c: Likewise. * lto-opts.c: Likewise. * lto-symtab.c: Likewise. * main.c: Likewise. * modulo-sched.c: Likewise. * optabs.c: Likewise. * params.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * profile.c: Likewise. * real.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * reorg.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtlanal.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-rgn.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-ir.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * targhooks.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-dump.c: Likewise. * tree-eh.c: Likewise. * tree-inline.c: Likewise. * tree-nomudflap.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-phinodes.c: Likewise. * tree-profile.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-uninit.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vrp.c: Likewise. * varasm.c: Likewise. * vec.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. c-family/ * c-common.h: Include diagnostic-core.h. Error if already included. * c-semantics.c: Do not define GCC_DIAG_STYLE here. cp/ * cp-tree.h: Do not include toplev.h. java/ * boehm.c: Include diagnostic-core.h in every file that includes toplev.h. * class.c: Likewise. * constants.c: Likewise. * decl.c: Likewise. * except.c: Likewise. * expr.c: Likewise. * jcf-parse.c: Likewise. * mangle.c: Likewise. * mangle_name.c: Likewise. * resource.c: Likewise. * typeck.c: Likewise. * verify-glue.c: Likewise. ada/ * gcc-interface/utils.c: Include diagnostic-core.h in every file that includes toplev.h. lto/ * lto-coff.c: Include diagnostic-core.h in every file that includes toplev.h. * lto-elf.c: Likewise. * lto-lang.c: Likewise. * lto-macho.c: Likewise. From-SVN: r161943
2010-07-08 06:22:54 +02:00
#include "diagnostic-core.h"
/* Include insn-config.h before expr.h so that HAVE_conditional_move
is properly defined. */
#include "insn-config.h"
1991-12-30 04:19:53 +01:00
#include "rtl.h"
genattrtab.c (write_header): Include hash-set.h... 2015-01-09 Michael Collison <michael.collison@linaro.org> * genattrtab.c (write_header): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-attrtab.c. * genautomata.c (main) : Include hash-set.h, macInclude hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-automata.c. * genemit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-emit.c. * gengtype.c (open_base_files): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating gtype-desc.c. * genopinit.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-opinit.c. * genoutput.c (output_prologue): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-output.c. * genpeep.c (main): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-peep.c. * genpreds.c (write_insn_preds_c): Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating insn-preds.c. * optc-save-gen-awk: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h when generating options-save.c. * opth-gen.awk: Change include guard from GCC_C_COMMON_H to GCC_C_COMMON_C when generating options.h. * ada/gcc-interface/cuintp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/decl.c: ditto. * ada/gcc-interface/misc.c: ditto. * ada/gcc-interface/targtyps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, real.h, fold-const.h, wide-int.h, inchash.h due to flattening of tree.h. * ada/gcc-interface/utils.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ada/gcc-interface/utils2.c: ditto. * alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * asan.c: ditto. * attribs.c: ditto. * auto-inc-dec.c: ditto. * auto-profile.c: ditto * bb-reorder.c: ditto. * bt-load.c: Include symtab.h due to flattening of tree.h. * builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c/c-array-notation.c: ditto. * c/c-aux-info.c: ditto. * c/c-convert.c: ditto. * c/c-decl.c: ditto. * c/c-errors.c: ditto. * c/c-lang.c: dittoxs. * c/c-objc-common.c: ditto. * c/c-parser.c: ditto. * c/c-typeck.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * calls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ccmp.c: ditto. * c-family/array-notation-common.c: ditto. * c-family/c-ada-spec.c: ditto. * c-family/c-cilkplus.c: ditto. * c-family/c-common.c: Include input.h due to flattening of tree.h. Define macro GCC_C_COMMON_C. * c-family/c-common.h: Flatten tree.h header files into c-common.h. Remove include of tree-core.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: ditto. * c-family/c-format.c: Flatten tree.h header files into c-common.h. * c-family/c-cppbuiltin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/c-format.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * c-family/c-gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * c-family/cilk.c: ditto. * c-family/c-lex.c: ditto. * c-family/c-omp.c: ditto. * c-family/c-opts.c: ditto. * c-family/c-pch.c: ditto. * c-family/c-ppoutput.c: ditto. * c-family/c-pragma.c: ditto. * c-family/c-pretty-print.c: ditto. * c-family/c-semantics.c: ditto. * c-family/c-ubsan.c: ditto. * c-family/stub-objc.c: ditto. * cfgbuild.c: ditto. * cfg.c: ditto. * cfgcleanup.c: ditto. * cfgexpand.c: ditto. * cfghooks.c: ditto. * cfgloop.c: Include symtab.h, fold-const.h, and inchash.h due to flattening of tree.h. * cfgloopmanip.c: ditto. * cfgrtl.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * cgraphbuild.c: ditto. * cgraph.c: ditto. * cgraphclones.c: ditto. * cgraphunit.c: ditto. * cilk-common.c: ditto. * combine.c: ditto. * combine-stack-adj.c: Include symbol.h due to flattening of tree.h. * config/aarch64/aarch64-builtins.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/aarch64/aarch64.c: ditto. * config/alpha/alpha.c: ditto. * config/arc/arc.c: ditto. * config/arm/aarch-common.c: ditto. * config/arm/arm-builtins.c: ditto. * config/arm/arm.c: ditto. * config/arm/arm-c.c: ditto. * config/avr/avr.c: ditto. * config/avr/avr-c.c: ditto. * config/avr/avr-log.c: ditto. * config/bfin/bfin.c: ditto. * config/c6x/c6x.c: ditto. * config/cr16/cr16.c: ditto. * config/cris/cris.c: ditto. * config/darwin.c: ditto. * config/darwin-c.c: ditto. * config/default-c.c: ditto. * config/epiphany/epiphany.c: ditto. * config/fr30/fr30.c: ditto. * config/frv/frv.c: ditto. * config/glibc-c.c: ditto. * config/h8300/h8300.c: ditto. * config/i386/i386.c: ditto. * config/i386/i386-c.c: ditto. * config/i386/msformat.c: ditto. * config/i386/winnt.c: ditto. * config/i386/winnt-cxx.c: ditto. * config/i386/winnt-stubs.c: ditto. * config/ia64/ia64.c: ditto. * config/ia64/ia64-c.c: ditto. * config/iq2000/iq2000.c: ditto. * config/lm32/lm32.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/m32c/m32c-pragma.c: ditto. * config/m32c/m32cr.c: ditto. * config/m68/m68k.c: ditto. * config/mcore/mcore.c: ditto. * config/mep/mep.c: ditto. * config/mep/mep-pragma.c: ditto. * config/microblaze/microblaze.c: ditto. * config/microblaze/microblaze-c.c: ditto. * config/mips/mips.c: ditto. * config/mmix/mmix.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/mn10300/mn10300.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/moxie/moxie.c: ditto. * config/msp430/msp430.c: ditto. * config/msp430/msp430-c.c: ditto. * config/nds32/nds32.c: ditto. * config/nds32/nds32-cost.c: ditto. * config/nds32/nds32-fp-as-gp.c: ditto. * config/nds32/nds32-intrinsic.c: ditto. * config/nds32/nds32-isr.c: ditto. * config/nds32/nds32-md-auxillary.c: ditto. * config/nds32/nds32-memory-manipulationx.c: ditto. * config/nds32/nds32-pipelines-auxillary.c: ditto. * config/nds32/nds32-predicates.c: ditto. * config/nios2/nios2.c: ditto. * config/nvptx/nvptx.c: ditto. * config/pa/pa.c: ditto. * config/pdp11/pdp11x.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/rl78/rl78-cx.c: ditto. * config/rs6000/rs6000.c: ditto. * config/rs6000/rs6000-c.c: ditto. * config/rx/rx.c: ditto. * config/s390/s390.c: ditto. * config/sh/sh.c: ditto. * config/sh/sc.c: ditto. * config/sh/sh-mem.cc: ditto. * config/sh/sh_treg_combine.cc: Include symtab.h, inchash.h and tree.h due to flattening of tree.h. Remove include of tree-core.h. * config/sol2.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/sol2-c.c: ditto. * config/sol2-cxx.c: ditto. * config/sol2-stubs.c: ditto. * config/sparc/sparc.c: ditto. * config/sparc/sparc-cx.c: ditto. * config/spu/spu.c: ditto. * config/spu/spu-c.c: ditto * config/storym16/stormy16.c: ditto. * config/tilegx/tilegx.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/gen-mul-tables.cc: Include symtab.h in generated file. * config/tilegx/tilegx-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/tilepro/tilepro-c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * config/v850/v850.c: ditto. * config/v850/v850-c.c: ditto. * config/vax/vax.c: ditto. * config/vms/vms.c: ditto. * config/vms/vms-c.c: ditto. * config/vxworks.c: ditto. * config/winnt-c.c: ditto. * config/xtensa/xtensa.c: Include symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * coverage.c: ditto. * cp/call.c: ditto. * cp/class.c: ditto. * cp/constexpr.c: ditto. * cp/cp-array-notation.c: ditto. * cp/cp-gimplify.c: ditto. * cp/cp-lang.c: ditto. * cp/cp-objcp-common.c: ditto. * cp/cvt.c: ditto. * cp/decl2.c: ditto. * cp/decl.c: ditto. * cp/dump.c: ditto. * cp/error.c: ditto. * cp/except.c: ditto. * cp/expr.c: ditto. * cp/friend.c: ditto. * cp/init.c: ditto. * cp/lambda.c: ditto. * cp/lex.c: ditto. * cp/mangle.c: ditto. * cp/name-lookup.c: ditto. * cp/optimize.c: ditto. * cp/parser.c: ditto. * cp/pt.c: ditto. * cp/ptree.c: ditto. * cp/repo.c: ditto. * cp/rtti.c: ditto. * cp/search.c: ditto. * cp/semantics.c: ditto. * cp/tree.c: ditto. * cp/typeck2.c: ditto. * cp/typeck.c: ditto. * cppbuiltin.c: ditto. * cprop.c: ditto. * cse.c: Add include of symtab.h due to flattening of tree.h. * cselib.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * data-streamer.c: ditto. * data-streamer-in.c: ditto. * data-streamer-out.c: ditto. * dbxout.c: ditto. * dce.c: ditto. * ddg.c: Add include of symtab.h due to flattening of tree.h. * debug.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * dfp.c: ditto. * df-scan.c: ditto. * dojump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * double-int.c: ditto. * dse.c: ditto. * dumpfile.c: ditto. * dwarf2asm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * dwarf2cfi.c: ditto. * dwarf2out.c: ditto. * emit-rtl.c: ditto. * except.c: ditto. * explow.c: ditto. * expmed.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * expr.c: ditto. * final.c: ditto. * fixed-value.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and fixed-value.h due to flattening of tree.h. * fold-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. Relocate inline function convert_to_ptrofftype_loc from tree.h. Relocate inline function fold_build_pointer_plus_loc from tree.h. Relocate inline function fold_build_pointer_plus_hwi_loc from tree.h. * fold-const.h: Relocate macro convert_to_ptrofftype from tree.h. Relocate macro fold_build_pointer_plus to relocate from tree.h.h. Relocate macro fold_build_pointer_plus_hwi from tree.h. Add prototype for convert_to_ptrofftype_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_loc relocated from tree.h. Add prototype for fold_build_pointer_plus_hwi_loc relocated from tree.h. * fortran/convert.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/cpp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/decl.c: ditto. * fortran/f95.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/iresolve.c: ditto. * fortran/match.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/module.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/options.c: ditto. * fortran/target-memory.c: Include hash-set.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-array.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-common.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-const.c: ditto. * fortran/trans-decl.c: ditto. * fortran/trans-expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-intrinsic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * fortran/trans-io.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * fortran/trans-openmp.c: ditto. * fortran/trans-stmt.c: ditto. * fortran/trans-types.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * function.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gcc-plugin.h: Include statistics.h, double-int.h, real.h, fixed-value.h, alias.h, flags.h, and symtab.h due to flattening of tree.h * gcse.c: ditto. * generic-match-head.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ggc-page.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-builder.c: ditto. * gimple.c: ditto. * gimple-expr.c: ditto. * gimple-fold.c: ditto. * gimple-iterator.c: ditto. * gimple-low.c: ditto. * gimple-match-head.c: ditto. * gimple-pretty-print.c: ditto. * generic-ssa-isolate-paths.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimple-ssa-strength-reduction.c: ditto. * gimple-streamer-in.c: ditto. * gimple-streamer-out.c: ditto. * gimple-walk.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * gimplify-me.c: ditto. * go/go-gcc.cc: ditto. * go/go-lang.c: ditto. * go/gdump.c: ditto. * graphite-blocking.c: ditto. * graphite.c: ditto. * graphite-dependencies.c: ditto. * graphite-interchange.c: ditto. * graphite-isl-ast-to-gimple.c: ditto. * graphite-optimize-isl.c: ditto. * graphite-poly.c: ditto. * graphite-scop-detection.c: ditto. * graphite-sese-to-poly.c: ditto. * hw-doloop.c: Include symtab.h due to flattening of tree.h. * ifcvt.c: ditto. * init-regs.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * internal-fc.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa.c: ditto. * ipa-chkp.c: ditto. * ipa-comdats.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-cp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-devirt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h,options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-icf-gimple.c: ditto. * ipa-inline-analysis.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-inline.c: ditto. * ipa-inline-transform.c: ditto. * ipa-polymorhpic-call.c: ditto. * ipa-profile.c: ditto. * ipa-prop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-pure-const.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ipa-reference.c: ditto. * ipa-split.c: ditto. * ipa-utils.c: ditto. * ipa-visbility.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ira.c: ditto. * ira-color.c: Include hash-set.h due to flattening of tree.h. * ira-costs.c: ditto. * ira-emit.c: ditto. * java/boehm.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/builtins.c: ditto. * java/class.c: ditto. * java/constants.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/decl.c: ditto. * java/except.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/expr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h,inchash.h and real.h due to flattening of tree.h. * java/gimplify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/jcf-dump.c: ditto. * java/jcf-io.c: ditto. * java/jcf-parse.c: ditto. * java/jvgenmain.c: ditto. * java/lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * java/mangle_name.c: ditto. * java/resource.c: ditto. * java/typeck.c: ditto. * java/verify-glue.c: ditto. * java/verify-impl.c: ditto. * jump.c: Include symtab.h due to flattening of tree.h. * langhooks.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-doloop.c: Include symtab.h due to flattening of tree.h. * loop-init.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * loop-invariant.c: Include symtab.h due to flattening of tree.h. * loop-iv.c: ditto. * loop-unroll.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lower-subreg.c: ditto. * lra-assigns.c: Include symtab.h due to flattening of tree.h. * lra.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * lra-coalesce.c: Include symtab.h due to flattening of tree.h. * lra-constraints.c: ditto. * lra-eliminations.c: ditto. * lra-livesc: ditto. * lra-remat.c: ditto. * lra-spills.c: ditto. * lto/lto.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-lang.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-object.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto/lto-partition.c: ditto. * lto/lto-symtab.c: ditto. * lto-cgraph.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-compress.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-opts.c: ditto. * lto-section-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * lto-section-out.c: ditto. * lto-streamer.c: ditto. * lto-streamer-in.c: ditto. * lto-streamer-out.c: ditto. * modulo-sched.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-act.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * objc/objc-encoding.c: ditto. * objc/objc-gnu-runtime-abi-01.c: ditto. * objc/objc-lang.c: ditto. * objc/objc-map.c: ditto. * objc/objc-next-runtime-abi-01.c: ditto. * objc/objc-next-runtime-abi-02.c: ditto. * objc/objc-runtime-shared-support.c: ditto. * objcp/objcp-decl.c: ditto. * objcp/objcp-lang.c: ditto. * omega.c: ditto. * omega-low.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * optabs.c: ditto. * opts-global.c: ditto. * passes.c: ditto. * plugin.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * postreload.c: Include symtab.h due to flattening of tree.h. * postreload-gcse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * predict.c: ditto. * print-rtl.c: ditto. * print-tree.c: ditto. * profile.c: Include symtab.h, fold-const.h and inchash.h due to flattening of tree.h. * real.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * realmpfr.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * recog.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * ree.c: ditto. * reginfo.c: ditto. * reg-stack.c: ditto. * reload1.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * reload.c: Include symtab.h due to flattening of tree.h. * reorg.c: ditto. * rtlanal.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * rtl-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * rtlhooks.c: Include symtab.h due to flattening of tree.h. * sanopt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-deps.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * sched-vis.c: ditto. * sdbout.c: ditto. * sel-sched.c: Include symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * sel-sched-ir.c: ditto. * sese.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * shrink-wrap.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * simplify-rtx.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * stack-ptr-mod.c: ditto. * stmt.c: ditto. * store-motion.c: ditto. * store-layout.c: ditto. * stringpool.c: ditto. * symtab.c: ditto. * target-globals.c: ditto. * targhooks.c: ditto. * toplev.c: ditto. * tracer.c: ditto. * trans-mem.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-affine.c: ditto. * tree-browser.c: ditto. * tree.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-call-cdce.c: Include symtab.h, alias.h, double-int.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-cfg.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-cfgcleanup.c: ditto. * tree-chkp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-chkp-opt.c: ditto. * tree-chrec.c: ditto. * tree-chkp-opt.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-core.h: Flatten header file by removing all #include statements. * tree-data-ref.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-dfa.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-diagnostic.c: ditto. * tree-dump.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-dfa.c: ditto. * tree-eh.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-emutls.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree.h: Flatten header files by removing all includes except tree-core.h. Remove inline function convert_to_ptrofftype_loc to relocate to fold-const.c. Remove macro convert_to_ptrofftype to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus to relocate to fold-const.h. Remove inline function fold_build_pointer_plus_hwi_loc to relocate to fold-const.c. Remove macro fold_build_pointer_plus_hwi to relocate to fold-const.h. * tree-if-conv.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-inline.c: ditto. * tree-into-ssa.c: ditto. * tree-iterator.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-loop-distribution.c: ditto. * tree-nested.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-nrv.c: ditto. * tree-object-size.c: ditto. * tree-outof-ssa.c: ditto. * tree-parloops.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-phinodes.c: ditto. * tree-predcom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-pretty-print.c: ditto. * tree-profile.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-scalar-evolution.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-sra.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, and inchash.h due to flattening of tree.h. * tree-ssa-alias.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa.c: ditto. * tree-ssa-ccp.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-coalesce.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-copy.c: ditto. * tree-ssa-copyrename.c: ditto. * tree-ssa-dce.c: ditto. * tree-ssa-dom.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h, inchash.h and real.h due to flattening of tree.h. * tree-ssa-dse.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-forwprop.c: ditto. * tree-ssa-ifcombine.c: ditto. * tree-ssa-live.c: ditto. * tree-ssa-loop.c: ditto. * tree-ssa-loop-ch.c: ditto. * tree-ssa-loop-im.c: ditto. * tree-ssa-loop-ivcanon.c: ditto. * tree-ssa-loop-ivopts.c: ditto. * tree-ssa-loop-manip.c: ditto. * tree-ssa-loop-niter.c: ditto. * tree-ssa-loop-prefetch.c: ditto. * tree-ssa-loop-unswitch.c: ditto. * tree-ssa-loop-math-opts.c: ditto. * tree-ssanames.c: ditto. * tree-ssa-operands.c: ditto. * tree-ssa-phiopt.c: ditto. * tree-ssa-phiprop.c: ditto. * tree-ssa-pre.c: ditto. * tree-ssa-propagate.c: ditto. * tree-ssa-reassoc.c: ditto. * tree-ssa-sccvn.c: ditto. * tree-ssa-sink.c: ditto. * tree-ssa-strlen.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-structalias.c: double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-tail-merge.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-ter.c: ditto. * tree-ssa-threadedge.c: ditto. * tree-ssa-threadupdate.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uncprop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-ssa-uninit.c: ditto. * tree-stdarg.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer.c: Include vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-streamer-in.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h, inchash.h, real.h and fixed-value.h due to flattening of tree.h. * tree-streamer-out.c: dittoo. * tree-switch-conversion.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-tailcall.c: ditto. * tree-vect-data-refs.c: ditto. * tree-vect-generic.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * tree-vect-loop-manip.c: ditto. * tree-vectorizer.c: ditto. * tree-vect-patterns.c: ditto. * tree-vect-slp.c: ditto. * tree-vect-stmts.c: ditto. * tree-vrp.c: ditto. * tsan.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * ubsan.c: ditto. * value-prof.c.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * varasm.c: ditto. * varpool.c: ditto. * var-tracking.c: ditto. * vmsdbgout.c: ditto. * vtable-verify.c: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * wide-int.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. * xcoffout.c: ditto. * libcc1/plugin.cc: Include hash-set.h, machmode.h, vec.h, double-int.h, input.h, alias.h, symtab.h, options.h, fold-const.h, wide-int.h and inchash.h due to flattening of tree.h. From-SVN: r219402
2015-01-09 21:18:42 +01:00
#include "alias.h"
1991-12-30 04:19:53 +01:00
#include "tree.h"
#include "tree-hasher.h"
Factor unrelated declarations out of tree.h. This patch applies the rule that functions defined in FOO.c must be declared in FOO.h. One of the worst offenders in the code base is tree.h, unsurprisingly. The patch creates several new headers: attribs.h calls.h fold-const.h gcc-symtab.h print-rtl.h print-tree.h stmt.h stor-layout.h stringpool.h tree-nested.h tree-object-size.h varasm.h. Functions in each corresponding .c file got moved to those headers and others that already existed. I wanted to make this patch as mechanical as possible, so I made no attempt to fix problems like having build_addr defined in tree-inline.c. I left that for later. There were some declarations that I could not move out of tree.h because of header poisoning or the use of target macros. We forbid the inclusion of things like expr.h from FE files. While that's a reasonable idea, the FE file *still* manage to at expr.c functionality because the declarations they want to use were defined in tree.h. The affected files are builtins.h, emit-rtl.h and expr.h. If that functionality is allowed to be accessed from the FEs, then I will later move those functions out of expr.c into tree.c. I have moved these declarations to the bottom of tree.h so they are easy to identify later. There is a namespace collision with libcpp. The file gcc/symtab.c cannot use gcc/symtab.h because the #include command picks up libcpp/include/symtab.h first. So I named this file gcc-symtab.h for now. Finally, I added a new header to PLUGIN_HEADERS to account for the tree.h refactoring. I did not add all headers factored out of tree.h because it is unclear (and impossible to tell) what plugins need. This adds the one header used by the plugins in the testsuite. This will be changing quite dramatically as we progress with the header refactoring. This patch should offer some minimal incremental build advantages by reducing the size of tree.h. Changes that would otherwise affected tree.h, will now go to other headers which are less frequently included. * tree.h: Include fold-const.h. (aggregate_value_p): Moved to function.h. (alloca_call_p): Moved to calls.h. (allocate_struct_function): Moved to function.h. (apply_tm_attr): Moved to attribs.h. (array_at_struct_end_p): Moved to expr.h. (array_ref_element_size): Moved to tree-dfa.h. (array_ref_low_bound): Moved to tree-dfa.h. (array_ref_up_bound): Moved to tree.h. (assemble_alias): Moved to cgraph.h. (bit_from_pos): Moved to stor-layout.h. (build_addr): Moved to tree-nested.h. (build_duplicate_type): Moved to tree-inline.h. (build_fold_addr_expr): Moved to fold-const.h. (build_fold_addr_expr_with_type): Moved to fold-const.h. (build_fold_addr_expr_with_type_loc): Moved to fold-const.h. (build_fold_indirect_ref): Moved to fold-const.h. (build_fold_indirect_ref_loc): Moved to fold-const.h. (build_personality_function): Moved to tree.h. (build_range_check): Moved to fold-const.h. (build_simple_mem_ref): Moved to fold-const.h. (build_simple_mem_ref_loc): Moved to fold-const.h. (build_tm_abort_call): Moved to trans-mem.h. (byte_from_pos): Moved to stor-layout.h. (call_expr_flags): Moved to calls.h. (can_move_by_pieces): Moved to expr.h. (categorize_ctor_elements): Moved to expr.h. (change_decl_assembler_name): Moved to gcc-symtab.h. (combine_comparisons): Moved to fold-const.h. (complete_ctor_at_level_p): Moved to tree.h. (component_ref_field_offset): Moved to tree-dfa.h. (compute_builtin_object_size): Moved to tree-object-size.h. (compute_record_mode): Moved to stor-layout.h. (constant_boolean_node): Moved to fold-const.h. (constructor_static_from_elts_p): Moved to varasm.h. (cxx11_attribute_p): Moved to attribs.h. (debug_body): Moved to print-tree.h. (debug_find_tree): Moved to tree-inline.h. (debug_fold_checksum): Moved to fold-const.h. (debug_head): Moved to print-tree.h. (debug_head): Moved to print-tree.h. (debug_raw): Moved to print-tree.h. (debug_tree): Moved to print-tree.h. (debug_vec_tree): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (debug_verbose): Moved to print-tree.h. (decl_attributes): Moved to attribs.h. (decl_binds_to_current_def_p): Moved to varasm.h. (decl_default_tls_model): Moved to varasm.h. (decl_replaceable_p): Moved to varasm.h. (div_if_zero_remainder): Moved to fold-const.h. (double_int mem_ref_offset): Moved to fold-const.h. (dump_addr): Moved to print-tree.h. (element_precision): Moved to machmode.h. (expand_dummy_function_end): Moved to function.h. (expand_function_end): Moved to function.h. (expand_function_start): Moved to function.h. (expand_label): Moved to stmt.h. (expr_first): Moved to tree-iterator.h. (expr_last): Moved to tree-iterator.h. (finalize_size_functions): Moved to stor-layout.h. (finish_builtin_struct): Moved to stor-layout.h. (finish_record_layout): Moved to stor-layout.h. (fixup_signed_type): Moved to stor-layout.h. (fixup_unsigned_type): Moved to stor-layout.h. (flags_from_decl_or_type): Moved to calls.h. (fold): Moved to fold-const.h. (fold_abs_const): Moved to fold-const.h. (fold_binary): Moved to fold-const.h. (fold_binary_loc): Moved to fold-const.h. (fold_binary_to_constant): Moved to fold-const.h. (fold_build1): Moved to fold-const.h. (fold_build1_initializer_loc): Moved to fold-const.h. (fold_build1_loc): Moved to fold-const.h. (fold_build1_stat_loc): Moved to fold-const.h. (fold_build2): Moved to fold-const.h. (fold_build2_initializer_loc): Moved to fold-const.h. (fold_build2_loc): Moved to fold-const.h. (fold_build2_stat_loc): Moved to fold-const.h. (fold_build3): Moved to fold-const.h. (fold_build3_loc): Moved to fold-const.h. (fold_build3_stat_loc): Moved to fold-const.h. (fold_build_call_array): Moved to fold-const.h. (fold_build_call_array_initializer): Moved to fold-const.h. (fold_build_call_array_initializer_loc): Moved to fold-const.h. (fold_build_call_array_loc): Moved to fold-const.h. (fold_build_cleanup_point_expr): Moved to fold-const.h. (fold_convert): Moved to fold-const.h. (fold_convert_loc): Moved to fold-const.h. (fold_convertible_p): Moved to fold-const.h. (fold_defer_overflow_warnings): Moved to fold-const.h. (fold_deferring_overflow_warnings_p): Moved to fold-const.h. (fold_fma): Moved to fold-const.h. (fold_ignored_result): Moved to fold-const.h. (fold_indirect_ref): Moved to fold-const.h. (fold_indirect_ref_1): Moved to fold-const.h. (fold_indirect_ref_loc): Moved to fold-const.h. (fold_read_from_constant_string): Moved to fold-const.h. (fold_real_zero_addition_p): Moved to fold-const.h. (fold_single_bit_test): Moved to fold-const.h. (fold_strip_sign_ops): Moved to fold-const.h. (fold_ternary): Moved to fold-const.h. (fold_ternary_loc): Moved to fold-const.h. (fold_unary): Moved to tree-data-ref.h. (fold_unary_ignore_overflow): Moved to fold-const.h. (fold_unary_ignore_overflow_loc): Moved to fold-const.h. (fold_unary_loc): Moved to fold-const.h. (fold_unary_to_constant): Moved to fold-const.h. (fold_undefer_and_ignore_overflow_warnings): Moved to fold-const.h. (fold_undefer_overflow_warnings): Moved to fold-const.h. (folding_initializer): Moved to fold-const.h. (free_temp_slots): Moved to function.h. (generate_setjmp_warnings): Moved to function.h. (get_attribute_name): Moved to attribs.h. (get_identifier): Moved to stringpool.h. (get_identifier_with_length): Moved to stringpool.h. (get_inner_reference): Moved to tree.h. (gimple_alloca_call_p): Moved to calls.h. (gimplify_parameters): Moved to function.h. (highest_pow2_factor): Moved to expr.h. (indent_to): Moved to print-tree.h. (init_attributes): Moved to attribs.h. (init_dummy_function_start): Moved to function.h. (init_function_start): Moved to function.h. (init_inline_once): Moved to tree-inline.h. (init_object_sizes): Moved to tree-object-size.h. (init_temp_slots): Moved to function.h. (init_tree_optimization_optabs): Moved to optabs.h. (initialize_sizetypes): Moved to stor-layout.h. (initializer_constant_valid_for_bitfield_p): Moved to varasm.h. (initializer_constant_valid_p): Moved to varasm.h. (int_const_binop): Moved to fold-const.h. (internal_reference_types): Moved to stor-layout.h. (invert_tree_comparison): Moved to fold-const.h. (invert_truthvalue): Moved to fold-const.h. (invert_truthvalue_loc): Moved to fold-const.h. (is_tm_ending_fndecl): Moved to trans-mem.h. (is_tm_may_cancel_outer): Moved to trans-mem.h. (is_tm_pure): Moved to trans-mem.h. (is_tm_safe): Moved to trans-mem.h. (layout_decl): Moved to stor-layout.h. (layout_type): Moved to stor-layout.h. (lookup_attribute_spec): Moved to attribs.h. (make_accum_type): Moved to stor-layout.h. (make_decl_one_only): Moved to varasm.h. (make_decl_rtl): Moved to tree.h. (make_decl_rtl_for_debug): Moved to varasm.h. (make_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_sat_unsigned_fract_type): Moved to stor-layout.h. (make_or_reuse_signed_accum_type): Moved to stor-layout.h. (make_or_reuse_signed_fract_type): Moved to stor-layout.h. (make_or_reuse_unsigned_accum_type): Moved to stor-layout.h. (make_or_reuse_unsigned_fract_type): Moved to stor-layout.h. (make_range): Moved to fold-const.h. (make_range_step): Moved to fold-const.h. (make_sat_signed_accum_type): Moved to stor-layout.h. (make_sat_signed_fract_type): Moved to stor-layout.h. (make_sat_unsigned_accum_type): Moved to stor-layout.h. (make_sat_unsigned_fract_type): Moved to stor-layout.h. (make_signed_accum_type): Moved to stor-layout.h. (make_signed_fract_type): Moved to stor-layout.h. (make_signed_type): Moved to stor-layout.h. (make_unsigned_accum_type): Moved to stor-layout.h. (make_unsigned_fract_type): Moved to stor-layout.h. (make_unsigned_type): Moved to stor-layout.h. (mark_decl_referenced): Moved to varasm.h. (mark_referenced): Moved to varasm.h. (may_negate_without_overflow_p): Moved to fold-const.h. (maybe_get_identifier): Moved to stringpool.h. (merge_ranges): Moved to fold-const.h. (merge_weak): Moved to varasm.h. (mode_for_size_tree): Moved to stor-layout.h. (multiple_of_p): Moved to fold-const.h. (must_pass_in_stack_var_size): Moved to calls.h. (must_pass_in_stack_var_size_or_pad): Moved to calls.h. (native_encode_expr): Moved to fold-const.h. (native_interpret_expr): Moved to fold-const.h. (non_lvalue): Moved to fold-const.h. (non_lvalue_loc): Moved to fold-const.h. (normalize_offset): Moved to stor-layout.h. (normalize_rli): Moved to stor-layout.h. (notice_global_symbol): Moved to varasm.h. (omit_one_operand): Moved to fold-const.h. (omit_one_operand_loc): Moved to fold-const.h. (omit_two_operands): Moved to fold-const.h. (omit_two_operands_loc): Moved to fold-const.h. (operand_equal_p): Moved to tree-data-ref.h. (parse_input_constraint): Moved to stmt.h. (parse_output_constraint): Moved to stmt.h. (place_field): Moved to stor-layout.h. (pop_function_context): Moved to function.h. (pop_temp_slots): Moved to function.h. (pos_from_bit): Moved to stor-layout.h. (preserve_temp_slots): Moved to function.h. (print_node): Moved to print-tree.h. (print_node_brief): Moved to print-tree.h. (print_rtl): Moved to rtl.h. (process_pending_assemble_externals): Moved to varasm.h. (ptr_difference_const): Moved to fold-const.h. (push_function_context): Moved to function.h. (push_struct_function): Moved to function.h. (push_temp_slots): Moved to function.h. (record_tm_replacement): Moved to trans-mem.h. (relayout_decl): Moved to stor-layout.h. (resolve_asm_operand_names): Moved to stmt.h. (resolve_unique_section): Moved to varasm.h. (rli_size_so_far): Moved to stor-layout.h. (rli_size_unit_so_far): Moved to stor-layout.h. (round_down): Moved to fold-const.h. (round_down_loc): Moved to fold-const.h. (round_up): Moved to fold-const.h. (round_up_loc): Moved to fold-const.h. (set_decl_incoming_rtl): Moved to emit-rtl.h. (set_decl_rtl): Moved to tree.h. (set_min_and_max_values_for_integral_type): Moved to stor-layout.h. (set_user_assembler_name): Moved to varasm.h. (setjmp_call_p): Moved to calls.h. (size_binop): Moved to fold-const.h. (size_binop_loc): Moved to fold-const.h. (size_diffop): Moved to fold-const.h. (size_diffop_loc): Moved to fold-const.h. (size_int_kind): Moved to fold-const.h. (stack_protect_epilogue): Moved to function.h. (start_record_layout): Moved to stor-layout.h. (supports_one_only): Moved to varasm.h. (swap_tree_comparison): Moved to fold-const.h. (tm_malloc_replacement): Moved to trans-mem.h. (tree build_fold_addr_expr_loc): Moved to fold-const.h. (tree build_invariant_address): Moved to fold-const.h. (tree_binary_nonnegative_warnv_p): Moved to fold-const.h. (tree_binary_nonzero_warnv_p): Moved to fold-const.h. (tree_call_nonnegative_warnv_p): Moved to fold-const.h. (tree_expr_nonnegative_p): Moved to fold-const.h. (tree_expr_nonnegative_warnv_p): Moved to fold-const.h. (tree_output_constant_def): Moved to varasm.h. (tree_overlaps_hard_reg_set): Moved to stmt.h. (tree_single_nonnegative_warnv_p): Moved to fold-const.h. (tree_single_nonzero_warnv_p): Moved to fold-const.h. (tree_swap_operands_p): Moved to fold-const.h. (tree_unary_nonnegative_warnv_p): Moved to fold-const.h. (tree_unary_nonzero_warnv_p): Moved to fold-const.h. (update_alignment_for_field): Moved to stor-layout.h. (use_register_for_decl): Moved to function.h. (variable_size): Moved to rtl.h. (vector_type_mode): Moved to stor-layout.h. * cgraph.h: Corresponding changes. * emit-rtl.h: Corresponding changes. * expr.h: Corresponding changes. * function.h: Corresponding changes. * optabs.h: Corresponding changes. * trans-mem.h: Corresponding changes. Protect against multiple inclusion. * tree-inline.h: Corresponding changes. * tree-iterator.h: Corresponding changes. * tree-dfa.h: Include expr.h. * tree-ssanames.h: Include stringpool.h. * attribs.h: New file. * calls.h: New file. * fold-const.h: New file. * gcc-symtab.h: New file. * print-rtl.h: New file. * print-tree.h: New file. * stmt.h: New file. * stor-layout.h: New file. * strinpool.h: New file. * tree-nested.h: New file * tree-object-size.h: New file. * varasm.h: New file. * Makefile.in (PLUGIN_HEADERS): Add stringpool.h. * alias.c: Include varasm.h. Include expr.h. * asan.c: Include calls.h. Include stor-layout.h. Include varasm.h. * attribs.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. * builtins.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. Include tree-object-size.h. * calls.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include attribs.h. * cfgexpand.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. * cgraph.c: Include varasm.h. Include calls.h. Include print-tree.h. * cgraphclones.c: Include stringpool.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * cgraphunit.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * cilk-common.c: Include stringpool.h. Include stor-layout.h. * combine.c: Include stor-layout.h. * config/aarch64/aarch64-builtins.c: Include stor-layout.h. Include stringpool.h. Include calls.h. * config/aarch64/aarch64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/alpha/alpha.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/arc/arc.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. Include calls.h. * config/arm/arm.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/avr/avr-c.c: Include stor-layout.h. * config/avr/avr-log.c: Include print-tree.h. * config/avr/avr.c: Include print-tree.h. Include calls.h. Include stor-layout.h. Include stringpool.h. * config/bfin/bfin.c: Include varasm.h. Include calls.h. * config/c6x/c6x.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/cr16/cr16.c: Include stor-layout.h. Include calls.h. * config/cris/cris.c: Include varasm.h. Include stor-layout.h. Include calls.h. Include stmt.h. * config/darwin.c: Include stringpool.h. Include varasm.h. Include stor-layout.h. * config/epiphany/epiphany.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/fr30/fr30.c: Include stor-layout.h. Include varasm.h. * config/frv/frv.c: Include varasm.h. Include stor-layout.h. Include stringpool.h. * config/h8300/h8300.c: Include stor-layout.h. Include varasm.h. Include calls.h. Include stringpool.h. * config/i386/i386.c: Include stringpool.h. Include attribs.h. Include calls.h. Include stor-layout.h. Include varasm.h. * config/i386/winnt-cxx.c: Include stringpool.h. Include attribs.h. * config/i386/winnt.c: Include stringpool.h. Include varasm.h. * config/ia64/ia64-c.c: Include stringpool.h. * config/ia64/ia64.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/iq2000/iq2000.c: Include stor-layout.h. Include calls.h. Include varasm.h. * config/lm32/lm32.c: Include calls.h. * config/m32c/m32c.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/m32r/m32r.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/m68k/m68k.c: Include calls.h. Include stor-layout.h. Include varasm.h. * config/mcore/mcore.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. Include calls.h. * config/mep/mep.c: Include varasm.h. Include calls.h. Include stringpool.h. Include stor-layout.h. * config/microblaze/microblaze.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mips/mips.c: Include varasm.h. Include stringpool.h. Include stor-layout.h. Include calls.h. * config/mmix/mmix.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/mn10300/mn10300.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/moxie/moxie.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/msp430/msp430.c: Include stor-layout.h. Include calls.h. * config/nds32/nds32.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/pa/pa.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include calls.h. * config/pdp11/pdp11.c: Include stor-layout.h. Include varasm.h. Include calls.h. * config/picochip/picochip.c: Include calls.h. Include stor-layout.h. Include stringpool.h. Include varasm.h. * config/rl78/rl78.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/rs6000/rs6000-c.c: Include stor-layout.h. Include stringpool.h. * config/rs6000/rs6000.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include print-tree.h. Include varasm.h. * config/rx/rx.c: Include varasm.h. Include stor-layout.h. Include calls.h. * config/s390/s390.c: Include print-tree.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/score/score.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. * config/sh/sh-c.c: Include stringpool.h. Include attribs.h.h. * config/sh/sh.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/sol2-c.c: Include stringpool.h. Include attribs.h. * config/sol2-cxx.c: Include stringpool.h. * config/sol2.c: Include stringpool.h. Include varasm.h. * config/sparc/sparc.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/spu/spu-c.c: Include stringpool.h. * config/spu/spu.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * config/stormy16/stormy16.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilegx/tilegx.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/tilepro/tilepro.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/v850/v850-c.c: Include stringpool.h. Include attribs.h. * config/v850/v850.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include calls.h. * config/vax/vax.c: Include calls.h. Include varasm.h. * config/vms/vms.c: Include stringpool.h. * config/vxworks.c: Include stringpool.h. * config/xtensa/xtensa.c: Include stringpool.h. Include stor-layout.h. Include calls.h. Include varasm.h. * convert.c: Include stor-layout.h. * coverage.c: Include stringpool.h. Include stor-layout.h. * dbxout.c: Include varasm.h. Include stor-layout.h. * dojump.c: Include stor-layout.h. * dse.c: Include stor-layout.h. * dwarf2asm.c: Include stringpool.h. Include varasm.h. * dwarf2cfi.c: Include stor-layout.h. * dwarf2out.c: Include rtl.h. Include stringpool.h. Include stor-layout.h. Include varasm.h. Include function.h. Include emit-rtl.h. Move inclusion of rtl.h earlier in the file. * emit-rtl.c: Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * explow.c: Include stor-layout.h. * expmed.c: Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. Include varasm.h. * final.c: Include varasm.h. * fold-const.c: Include stor-layout.h. Include calls.h. Include tree-iterator.h. * function.c: Include stor-layout.h. Include varasm.h. Include stringpool.h. * genattrtab.c (write_header): Emit includes for varasm.h, stor-layout.h and calls.h. * genautomata.c (main): Likewise. * genemit.c: Likewise. * genopinit.c: Likewise. * genoutput.c (output_prologue): Likewise. * genpeep.c: Likewise. * genpreds.c (write_insn_preds_c): Likewise. * gengtype.c (open_base_files): Add stringpool.h. * gimple-expr.c: Include stringpool.h. Include stor-layout.h. * gimple-fold.c: Include stringpool.h. Include expr.h. Include stmt.h. Include stor-layout.h. * gimple-low.c: Include tree-nested.h. Include calls.h. * gimple-pretty-print.c: Include stringpool.h. * gimple-ssa-strength-reduction.c: Include stor-layout.h. Include expr.h. * gimple-walk.c: Include stmt.h. * gimple.c: Include calls.h. Include stmt.h. Include stor-layout.h. * gimplify.c: Include stringpool.h. Include calls.h. Include varasm.h. Include stor-layout.h. Include stmt.h. Include print-tree.h. Include expr.h. * gimplify-me.c: Include stmt.h Include stor-layout.h * internal-fn.c: Include stor-layout.h. * ipa-devirt.c: Include print-tree.h. Include calls.h. * ipa-inline-analysis.c: Include stor-layout.h. Include stringpool.h. Include print-tree.h. * ipa-inline.c: Include trans-mem.h. Include calls.h. * ipa-prop.c: Include expr.h. Include stor-layout.h. Include print-tree.h. * ipa-pure-const.c: Include print-tree.h. Include calls.h. * ipa-reference.c: Include calls.h. * ipa-split.c: Include stringpool.h. Include expr.h. Include calls.h. * ipa.c: Include calls.h. Include stringpool.h. * langhooks.c: Include stringpool.h. Include attribs.h. * lto-cgraph.c: Include stringpool.h. * lto-streamer-in.c: Include stringpool.h. * lto-streamer-out.c: Include stor-layout.h. Include stringpool.h. * omp-low.c: Include stringpool.h. Include stor-layout.h. Include expr.h. * optabs.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * passes.c: Include varasm.h. * predict.c: Include calls.h. * print-rtl.c: Include print-tree.h. * print-tree.c: Include varasm.h. Include print-rtl.h. Include stor-layout.h. * realmpfr.c: Include stor-layout.h. * reg-stack.c: Include varasm.h. * sdbout.c: Include varasm.h. Include stor-layout.h. * simplify-rtx.c: Include varasm.h. * stmt.c: Include varasm.h. Include stor-layout.h. * stor-layout.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. Include print-tree.h. * symtab.c: Include rtl.h. Include print-tree.h. Include varasm.h. Include function.h. Include emit-rtl.h. * targhooks.c: Include stor-layout.h. Include varasm.h. * toplev.c: Include varasm.h. Include tree-inline.h. * trans-mem.c: Include calls.h. Include function.h. Include rtl.h. Include emit-rtl.h. * tree-affine.c: Include expr.h. * tree-browser.c: Include print-tree.h. * tree-call-cdce.c: Include stor-layout.h. * tree-cfg.c: Include trans-mem.h. Include stor-layout.h. Include print-tree.h. * tree-complex.c: Include stor-layout.h. * tree-data-ref.c: Include expr.h. * tree-dfa.c: Include stor-layout.h. * tree-eh.c: Include expr.h. Include calls.h. * tree-emutls.c: Include stor-layout.h. Include varasm.h. * tree-if-conv.c: Include stor-layout.h. * tree-inline.c: Include stor-layout.h. Include calls.h. * tree-loop-distribution.c: Include stor-layout.h. * tree-nested.c: Include stringpool.h. Include stor-layout.h. * tree-object-size.c: Include tree-object-size.h. * tree-outof-ssa.c: Include stor-layout.h. * tree-parloops.c: Include stor-layout.h. Include tree-nested.h. * tree-pretty-print.c: Include stor-layout.h. Include expr.h. * tree-profile.c: Include varasm.h. Include tree-nested.h. * tree-scalar-evolution.c: Include expr.h. * tree-sra.c: Include stor-layout.h. * tree-ssa-address.c: Include stor-layout.h. * tree-ssa-ccp.c: Include stor-layout.h. * tree-ssa-dce.c: Include calls.h. * tree-ssa-dom.c: Include stor-layout.h. * tree-ssa-forwprop.c: Include stor-layout.h. * tree-ssa-ifcombine.c: Include stor-layout.h. * tree-ssa-loop-ivopts.c: Include stor-layout.h. * tree-ssa-loop-niter.c: Include calls.h. Include expr.h. * tree-ssa-loop-prefetch.c: Include stor-layout.h. * tree-ssa-math-opts.c: Include stor-layout.h. * tree-ssa-operands.c: Include stmt.h. Include print-tree.h. * tree-ssa-phiopt.c: Include stor-layout.h. * tree-ssa-reassoc.c: Include stor-layout.h. * tree-ssa-sccvn.c: Include stor-layout.h. * tree-ssa-sink.c: Include stor-layout.h. * tree-ssa-strlen.c: Include stor-layout.h. * tree-ssa-structalias.c: Include stor-layout.h. Include stmt.h. * tree-ssa-tail-merge.c: Include stor-layout.h. Include trans-mem.h. * tree-ssa-uncprop.c: Include stor-layout.h. * tree-ssa.c: Include stor-layout.h. * tree-ssanames.c: Include stor-layout.h. * tree-streamer-in.c: Include stringpool.h. * tree-streamer-out.c: Include stor-layout.h. * tree-switch-conversion.c: Include varasm.h. Include stor-layout.h. * tree-tailcall.c: Include stor-layout.h. * tree-vect-data-refs.c: Include stor-layout.h. * tree-vect-generic.c: Include stor-layout.h. * tree-vect-loop.c: Include stor-layout.h. * tree-vect-patterns.c: Include stor-layout.h. * tree-vect-slp.c: Include stor-layout.h. * tree-vect-stmts.c: Include stor-layout.h. * tree-vectorizer.c: Include stor-layout.h. * tree-vrp.c: Include stor-layout.h. Include calls.h. * tree.c: Include stor-layout.h. Include calls.h. Include attribs.h. Include varasm.h. * tsan.c: Include expr.h. * ubsan.c: Include stor-layout.h. Include stringpool.h. * value-prof.c: Include tree-nested.h. Include calls.h. * var-tracking.c: Include varasm.h. Include stor-layout.h. * varasm.c: Include stor-layout.h. Include stringpool.h. Include gcc-symtab.h. Include varasm.h. * varpool.c: Include varasm.h. * vmsdbgout.c: Include varasm.h. * xcoffout.c: Include varasm.h. ada/ChangeLog * gcc-interface/decl.c: Include stringpool.h Include stor-layout.h * gcc-interface/misc.c: Include stor-layout.h Include print-tree.h * gcc-interface/trans.c: Include stringpool.h Include stor-layout.h Include stmt.h Include varasm.h * gcc-interface/utils.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h * gcc-interface/utils2.c: Include stringpool.h Include stor-layout.h Include attribs.h Include varasm.h c-family/ChangeLog * c-common.c: Include fold-const.h. Include stor-layout.h. Include calls.h. Include stringpool.h. Include attribs.h. Include varasm.h. Include trans-mem.h. * c-cppbuiltin.c: Include stor-layout.h. Include stringpool.h. * c-format.c: Include stringpool.h. * c-lex.c: Include stringpool.h. Include stor-layout.h. * c-pragma.c: Include stringpool.h. Include attribs.h. Include varasm.h. Include gcc-symtab.h. * c-pretty-print.c: Include stor-layout.h. Include attribs.h. * cilk.c: Include stringpool.h. Include calls.h. c/ChangeLog * c-decl.c: Include print-tree.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include stringpool.h. * c-lang.c: Include fold-const.h. * c-parser.c: Include stringpool.h. Include attribs.h. Include stor-layout.h. Include varasm.h. Include trans-mem.h. * c-typeck.c: Include stor-layout.h. Include trans-mem.h. Include varasm.h. Include stmt.h. cp/ChangeLog * call.c: Include stor-layout.h. Include trans-mem.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * cp-gimplify.c: Include stor-layout.h. * cvt.c: Include stor-layout.h. * decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. Include calls.h. * decl2.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. Include calls.h. * error.c: Include stringpool.h. * except.c: Include stringpool.h. Include trans-mem.h. Include attribs.h. * init.c: Include stringpool.h. Include varasm.h. * lambda.c: Include stringpool.h. * lex.c: Include stringpool.h. * mangle.c: Include stor-layout.h. Include stringpool.h. * method.c: Include stringpool.h. Include varasm.h. * name-lookup.c: Include stringpool.h. Include print-tree.h. Include attribs.h. * optimize.c: Include stringpool.h. * parser.c: Include print-tree.h. Include stringpool.h. Include attribs.h. Include trans-mem.h. * pt.c: Include stringpool.h. Include varasm.h. Include attribs.h. Include stor-layout.h. * ptree.c: Include print-tree.h. * repo.c: Include stringpool.h. * rtti.c: Include stringpool.h. Include stor-layout.h. * semantics.c: Include stmt.h. Include varasm.h. Include stor-layout.h. Include stringpool.h. * tree.c: Include stor-layout.h. Include print-tree.h. Include tree-iterator.h. * typeck.c: Include stor-layout.h. Include varasm.h. * typeck2.c: Include stor-layout.h. Include varasm.h. * vtable-class-hierarchy.c: Include stringpool.h. Include stor-layout.h. fortran/ChangeLog * decl.c: Include stringpool.h. * iresolve.c: Include stringpool.h. * match.c: Include stringpool.h. * module.c: Include stringpool.h. * target-memory.c: Include stor-layout.h. * trans-common.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * trans-const.c: Include stor-layout.h. * trans-decl.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. Include attribs.h. * trans-expr.c: Include stringpool.h. * trans-intrinsic.c: Include stringpool.h. Include tree-nested.h. Include stor-layout.h. * trans-io.c: Include stringpool.h. Include stor-layout.h. * trans-openmp.c: Include stringpool.h. * trans-stmt.c: Include stringpool.h. * trans-types.c: Include stor-layout.h. Include stringpool.h. * trans.c: Include stringpool.h. go/ChangeLog * go-backend.c: Include stor-layout.h. * go-gcc.cc: Include stringpool.h. Include stor-layout.h. Include varasm.h. * go-lang.c: Include stor-layout.h. java/ChangeLog * builtins.c: Include stor-layout.h. Include stringpool.h. * class.c: Include stringpool.h. Include stor-layout.h. Include varasm.h. * constants.c: Include stringpool.h. Include stor-layout.h. * decl.c: Include stor-layout.h. Include stringpool.h. Include varasm.h. * except.c: Include stringpool.h. Include stor-layout.h. * expr.c: Include stringpool.h. Include stor-layout.h. * jcf-parse.c: Include stringpool.h. * mangle.c: Include stringpool.h. * resource.c: Include stringpool.h. Include stor-layout.h. * typeck.c: Include stor-layout.h. Include stringpool.h. * verify-glue.c: Include stringpool.h. lto/ChangeLog * lto-lang.c: Include stringpool.h. Include stor-layout.h. * lto-partition.c: Include gcc-symtab.h. * lto.c: Include stor-layout.h. objc/ChangeLog * objc-act.c: Include stringpool.h. Include stor-layout.h. Include attribs.h. * objc-encoding.c: Include stringpool.h. Include stor-layout.h. * objc-gnu-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-01.c: Include stringpool.h. * objc-next-runtime-abi-02.c: Include stringpool.h. * objc-runtime-shared-support.c: Include stringpool.h. testsuite/ChangeLog * gcc.dg/plugin/selfassign.c: Include stringpool.h. * gcc.dg/plugin/start_unit_plugin.c: Likewise. From-SVN: r205023
2013-11-19 13:31:09 +01:00
#include "stor-layout.h"
#include "stringpool.h"
#include "varasm.h"
#include "tm_p.h"
1991-12-30 04:19:53 +01:00
#include "flags.h"
#include "except.h"
dojump.h: New header file. 2015-10-15 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org> * dojump.h: New header file. * explow.h: Likewise. * expr.h: Remove includes. Move expmed.c prototypes to expmed.h. Move dojump.c prototypes to dojump.h. Move alias.c prototypes to alias.h. Move explow.c prototypes to explow.h. Move calls.c prototypes to calls.h. Move emit-rtl.c prototypes to emit-rtl.h. Move varasm.c prototypes to varasm.h. Move stmt.c prototypes to stmt.h. (saved_pending_stack_adjust): Move to dojump.h. (adjust_address): Move to explow.h. (adjust_address_nv): Move to emit-rtl.h. (adjust_bitfield_address): Likewise. (adjust_bitfield_address_size): Likewise. (adjust_bitfield_address_nv): Likewise. (adjust_automodify_address_nv): Likewise. * explow.c (expr_size): Move to expr.c. (int_expr_size): Likewise. (tree_expr_size): Likewise. Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h varasm.h. * genemit.c (main): Generate includes statistics.h, real.h, fixed-value.h, insn-config.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genopinit.c (main): Generate includes hashtab.h, hard-reg-set.h, function.h, statistics.h, real.h, fixed-value.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genoutput.c (main): Generate includes hashtab.h, statistics.h, real.h, fixed-value.h, expmed.h, dojump.h, explow.h, emit-rtl.h, stmt.h. * genemit.c (open_base_files): Generate includes flags.h, statistics.h, real.h, fixed-value.h, tree.h, expmed.h, dojump.h, explow.h, calls.h, emit-rtl.h, varasm.h, stmt.h. * config/tilepro/gen-mul-tables.cc: Generate includes hashtab.h, hash-set.h, vec.h, machmode.h, tm.h, hard-reg-set.h, input.h, function.h, rtl.h, flags.h, statistics.h, double-int.h, real.h, fixed-value.h, alias.h, wide-int.h, inchash.h, tree.h, insn-config.h, expmed.h, dojump.h, explow.h, calls.h, emit-rtl.h, varasm.h, stmt.h. * config/tilegx/mul-tables.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hash-set.h hashtab.h inchash.h input.h insn-config.h machmode.h real.h rtl.h statistics.h stmt.h symtab.h tm.h tree.h varasm.h vec.h wide-int.h. * rtlhooks.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hash-set.h hashtab.h inchash.h input.h insn-config.h machmode.h real.h statistics.h stmt.h tree.h varasm.h vec.h wide-int.h. * cfgloopanal.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h inchash.h insn-config.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * loop-iv.c: Likewise. * lra-assigns.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * lra-constraints.c: Likewise. * lra-eliminations.c: Likewise. * lra-lives.c: Likewise. * lra-remat.c: Likewise. * bt-load.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h insn-config.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * hw-doloop.c: Likewise. * ira-color.c: Likewise. * ira-emit.c: Likewise. * loop-doloop.c: Likewise. * loop-invariant.c: Likewise. * reload.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h real.h rtl.h statistics.h stmt.h tree.h varasm.h wide-int.h. * caller-save.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * combine-stack-adj.c: Likewise. * cse.c: Likewise. * ddg.c: Likewise. * ifcvt.c: Likewise. * ira-costs.c: Likewise. * jump.c: Likewise. * lra-coalesce.c: Likewise. * lra-spills.c: Likewise. * profile.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h wide-int.h. * lra.c: Include alias.h calls.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * config/sh/sh_treg_combine.cc: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h flags.h real.h statistics.h stmt.h varasm.h wide-int.h. * reorg.c: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h inchash.h real.h statistics.h stmt.h tree.h varasm.h wide-int.h. * reload1.c: Include alias.h calls.h dojump.h double-int.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * config/tilegx/tilegx.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h real.h statistics.h stmt.h. * config/tilepro/tilepro.c: Likewise. * config/mmix/mmix.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * config/pdp11/pdp11.c: Likewise. * config/xtensa/xtensa.c: Likewise. * config/lm32/lm32.c: Include alias.h dojump.h double-int.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * tree-chkp.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h tm.h. * cilk-common.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h tm.h varasm.h. * rtl-chkp.c: Likewise. * tree-chkp-opt.c: Likewise. * config/arm/arm-builtins.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * ipa-icf.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * tree-vect-data-refs.c: Likewise. * graphite-sese-to-poly.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * internal-fn.c: Likewise. * ipa-icf-gimple.c: Likewise. * lto-section-out.c: Likewise. * tree-data-ref.c: Likewise. * tree-nested.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-strlen.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tsan.c: Likewise. * targhooks.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/sh/sh-mem.cc: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * loop-unroll.c: Likewise. * ubsan.c: Likewise. * tree-ssa-loop-prefetch.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * dse.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h function.h hashtab.h statistics.h stmt.h varasm.h. * tree-switch-conversion.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * generic-match-head.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * gimple-match-head.c: Likewise. * lto-cgraph.c: Likewise. * lto-section-in.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-if-conv.c: Likewise. * tree-into-ssa.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-generic.c: Likewise. * tree-sra.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h stmt.h varasm.h. * stor-layout.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h. * varasm.c: Likewise. * coverage.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * init-regs.c: Likewise. * ira.c: Likewise. * omp-low.c: Likewise. * stack-ptr-mod.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-complex.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h rtl.h statistics.h stmt.h varasm.h. * dwarf2cfi.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h statistics.h stmt.h varasm.h. * shrink-wrap.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h rtl.h statistics.h stmt.h. * recog.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * tree-ssa-phiopt.c: Likewise. * config/darwin.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h. * config/fr30/fr30.c: Likewise. * config/frv/frv.c: Likewise. * expr.c: Likewise. * final.c: Likewise. * optabs.c: Likewise. * passes.c: Likewise. * simplify-rtx.c: Likewise. * stmt.c: Likewise. * toplev.c: Likewise. * var-tracking.c: Likewise. * gcse.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * lower-subreg.c: Likewise. * postreload-gcse.c: Likewise. * ree.c: Likewise. * reginfo.c: Likewise. * store-motion.c: Likewise. * combine.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h stmt.h varasm.h. * emit-rtl.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h. * dojump.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h varasm.h. * except.c: Likewise. * explow.c: Likewise. * tree-dfa.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * gimple-fold.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h varasm.h. * tree-ssa-structalias.c: Likewise. * cfgexpand.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h. * calls.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * bb-reorder.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h. * cfgbuild.c: Likewise. * function.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h. * cfgrtl.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * dbxout.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * auto-inc-dec.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h varasm.h. * cprop.c: Likewise. * modulo-sched.c: Likewise. * postreload.c: Likewise. * ccmp.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * gimple-ssa-strength-reduction.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * tree-ssa-loop-ivopts.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h flags.h hashtab.h real.h rtl.h statistics.h stmt.h varasm.h. * expmed.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h function.h hard-reg-set.h hashtab.h real.h statistics.h stmt.h varasm.h. * target-globals.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h function.h hashtab.h real.h statistics.h stmt.h varasm.h. * tree-ssa-address.c: Include calls.h dojump.h emit-rtl.h explow.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * cfgcleanup.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h function.h real.h statistics.h stmt.h varasm.h. * alias.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * dwarf2out.c: Include calls.h dojump.h explow.h expmed.h fixed-value.h statistics.h stmt.h. * config/nvptx/nvptx.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hard-reg-set.h insn-config.h real.h statistics.h stmt.h varasm.h. * gimplify.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h. * asan.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h. * ipa-devirt.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * ipa-polymorphic-call.c: Likewise. * config/aarch64/aarch64.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/c6x/c6x.c: Likewise. * config/aarch64/aarch64-builtins.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h flags.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. * ipa-prop.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h rtl.h statistics.h stmt.h varasm.h. * ipa-split.c: Likewise. * tree-eh.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-vrp.c: Likewise. * config/nds32/nds32-cost.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h insn-config.h real.h statistics.h stmt.h. * config/nds32/nds32-fp-as-gp.c: Likewise. * config/nds32/nds32-intrinsic.c: Likewise. * config/nds32/nds32-isr.c: Likewise. * config/nds32/nds32-md-auxiliary.c: Likewise. * config/nds32/nds32-memory-manipulation.c: Likewise. * config/nds32/nds32-pipelines-auxiliary.c: Likewise. * config/nds32/nds32-predicates.c: Likewise. * config/nds32/nds32.c: Likewise. * config/cris/cris.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h. * config/alpha/alpha.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h. * config/arm/arm.c: Likewise. * config/avr/avr.c: Likewise. * config/bfin/bfin.c: Likewise. * config/h8300/h8300.c: Likewise. * config/i386/i386.c: Likewise. * config/ia64/ia64.c: Likewise. * config/iq2000/iq2000.c: Likewise. * config/m32c/m32c.c: Likewise. * config/m32r/m32r.c: Likewise. * config/m68k/m68k.c: Likewise. * config/mcore/mcore.c: Likewise. * config/mep/mep.c: Likewise. * config/mips/mips.c: Likewise. * config/mn10300/mn10300.c: Likewise. * config/moxie/moxie.c: Likewise. * config/pa/pa.c: Likewise. * config/rl78/rl78.c: Likewise. * config/rx/rx.c: Likewise. * config/s390/s390.c: Likewise. * config/sh/sh.c: Likewise. * config/sparc/sparc.c: Likewise. * config/spu/spu.c: Likewise. * config/stormy16/stormy16.c: Likewise. * config/v850/v850.c: Likewise. * config/vax/vax.c: Likewise. * config/cr16/cr16.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h real.h statistics.h stmt.h varasm.h. * config/msp430/msp430.c: Likewise. * predict.c: Likewise. * value-prof.c: Likewise. * config/epiphany/epiphany.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h hashtab.h statistics.h stmt.h. * config/microblaze/microblaze.c: Likewise. * config/nios2/nios2.c: Likewise. * config/rs6000/rs6000.c: Likewise. * tree.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h rtl.h statistics.h stmt.h. * cgraph.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h. * fold-const.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h insn-config.h real.h statistics.h stmt.h varasm.h. * tree-inline.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h rtl.h statistics.h stmt.h varasm.h. * builtins.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h real.h statistics.h stmt.h. * config/arc/arc.c: Include dojump.h emit-rtl.h explow.h expmed.h fixed-value.h statistics.h stmt.h. * config/visium/visium.c: Include dojump.h emit-rtl.h explow.h expmed.h stmt.h. java/ * builtins.c: Include calls.h dojump.h emit-rtl.h explow.h expmed.h fixed-value.h function.h hard-reg-set.h hashtab.h insn-config.h real.h statistics.h stmt.h varasm.h. From-SVN: r219655
2015-01-15 14:28:42 +01:00
#include "expmed.h"
#include "dojump.h"
#include "explow.h"
#include "calls.h"
#include "emit-rtl.h"
#include "stmt.h"
1991-12-30 04:19:53 +01:00
#include "expr.h"
2014-11-01 Andrew MacLeod <amacleod@redhat,com> * optabs.h: Flatten insn-codes.h to source files. Move some prototypes and structs to genopinit.c. Adjust protyoptypes to match optabs.c. * genopinit.c (main): Emit prototypes and structs into insn-opinit.h. * optabs.c: (gen_move_insn): Move to expr.c. * expr.h: Move protypes and enums to optabs.h. * expr.c: (gen_move_insn): Relocate from optabs.c. * genemit.c (main): Include insn-codes.h. * gengtype.c (open_base_files): Include insn-codes.h. * asan.c: Include insn-codes.h. * bb-reorder.c: Ditto. * builtins.c: Ditto. * calls.c: Ditto. * cfgexpand.c: Ditto. * cilk-common.c: Ditto. * combine.c: Ditto. * dojump.c: Ditto. * dse.c: Ditto. * except.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * function.c: Ditto. * ifcvt.c: Ditto. * internal-fn.c: Ditto. * loop-unroll.c: Ditto. * lra.c: Ditto. * modulo-sched.c: Ditto. * omp-low.c: Ditto. * postreload.c: Ditto. * ree.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * shrink-wrap.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * target-globals.c: Ditto. * targhooks.c: Ditto. * toplev.c: Ditto. * tree-if-conv.c: Ditto. * tree-ssa-forwprop.c: Ditto. * tree-ssa-loop-prefetch.c: Ditto. * tree-ssa-math-opts.c: Ditto. * tree-ssa-phiopt.c: Ditto. * tree-ssa-reassoc.c: Ditto. * tree-switch-conversion.c: Ditto. * tree-vect-data-refs.c: Ditto. * tree-vect-generic.c: Ditto. * tree-vect-loop.c: Ditto. * tree-vect-patterns.c: Ditto. * tree-vect-slp.c: Ditto. * tree-vect-stmts.c: Ditto. * tree-vrp.c: Ditto. * value-prof.c: Ditto. * config/aarch64/aarch64-builtins.c: Ditto. * config/alpha/alpha.c: Ditto. * config/arm/arm.c: Ditto. * config/cris/cris.c: Ditto. * config/epiphany/epiphany.c: Ditto. * config/frv/frv.c: Ditto. * config/h8300/h8300.c: Ditto. * config/ia64/ia64.c: Ditto. * config/iq2000/iq2000.c: Ditto. * config/m32c/m32c.c: Ditto. * config/mep/mep.c: Ditto. * config/microblaze/microblaze.c: Ditto. * config/mips/mips.c: Ditto. * config/mn10300/mn10300.c: Ditto. * config/moxie/moxie.c: Ditto. * config/msp430/msp430.c: Ditto. * config/nios2/nios2.c: Ditto. * config/pa/pa.c: Ditto. * config/rl78/rl78.c: Ditto. * config/rs6000/rs6000.c: Ditto. * config/rx/rx.c: Ditto. * config/s390/s390.c: Ditto. * config/sh/sh.c: Ditto. * config/sh/sh_treg_combine.cc: Ditto. * config/spu/spu.c: Ditto. * config/stormy16/stormy16.c: Ditto. * config/tilegx/mul-tables.c: Ditto. * config/tilegx/tilegx.c: Ditto. * config/tilepro/mul-tables.c: Ditto. * config/tilepro/tilepro.c: Ditto. * config/vax/vax.c: Ditto. From-SVN: r217005
2014-11-01 14:34:15 +01:00
#include "insn-codes.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"
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
struct target_optabs default_target_optabs;
struct target_libfuncs default_target_libfuncs;
struct target_optabs *this_fn_optabs = &default_target_optabs;
#if SWITCHABLE_TARGET
struct target_optabs *this_target_optabs = &default_target_optabs;
struct target_libfuncs *this_target_libfuncs = &default_target_libfuncs;
#endif
#define libfunc_hash \
(this_target_libfuncs->x_libfunc_hash)
static void prepare_float_lib_cmp (rtx, rtx, enum rtx_code, rtx *,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode *);
static rtx expand_unop_direct (machine_mode, optab, rtx, rtx, int);
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
static void emit_libcall_block_1 (rtx_insn *, rtx, rtx, rtx, bool);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Debug facility for use in GDB. */
void debug_optab_libfuncs (void);
/* Prefixes for the current version of decimal floating point (BID vs. DPD) */
#if ENABLE_DECIMAL_BID_FORMAT
#define DECIMAL_PREFIX "bid_"
#else
#define DECIMAL_PREFIX "dpd_"
#endif
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Used for libfunc_hash. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
hashval_t
libfunc_hasher::hash (libfunc_entry *e)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
return ((e->mode1 + e->mode2 * NUM_MACHINE_MODES) ^ e->op);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
}
/* Used for libfunc_hash. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
bool
libfunc_hasher::equal (libfunc_entry *e1, libfunc_entry *e2)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
return e1->op == e2->op && e1->mode1 == e2->mode1 && e1->mode2 == e2->mode2;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
}
/* Return libfunc corresponding operation defined by OPTAB converting
from MODE2 to MODE1. Trigger lazy initialization if needed, return NULL
if no libfunc is available. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
convert_optab_libfunc (convert_optab optab, machine_mode mode1,
machine_mode mode2)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
struct libfunc_entry e;
struct libfunc_entry **slot;
/* ??? This ought to be an assert, but not all of the places
that we expand optabs know about the optabs that got moved
to being direct. */
if (!(optab >= FIRST_CONV_OPTAB && optab <= LAST_CONVLIB_OPTAB))
return NULL_RTX;
e.op = optab;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
e.mode1 = mode1;
e.mode2 = mode2;
slot = libfunc_hash->find_slot (&e, NO_INSERT);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (!slot)
{
const struct convert_optab_libcall_d *d
= &convlib_def[optab - FIRST_CONV_OPTAB];
if (d->libcall_gen == NULL)
return NULL;
d->libcall_gen (optab, d->libcall_basename, mode1, mode2);
slot = libfunc_hash->find_slot (&e, NO_INSERT);
if (!slot)
return NULL;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
}
return (*slot)->libfunc;
}
/* Return libfunc corresponding operation defined by OPTAB in MODE.
Trigger lazy initialization if needed, return NULL if no libfunc is
available. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
optab_libfunc (optab optab, machine_mode mode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
struct libfunc_entry e;
struct libfunc_entry **slot;
/* ??? This ought to be an assert, but not all of the places
that we expand optabs know about the optabs that got moved
to being direct. */
if (!(optab >= FIRST_NORM_OPTAB && optab <= LAST_NORMLIB_OPTAB))
return NULL_RTX;
e.op = optab;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
e.mode1 = mode;
e.mode2 = VOIDmode;
slot = libfunc_hash->find_slot (&e, NO_INSERT);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (!slot)
{
const struct optab_libcall_d *d
= &normlib_def[optab - FIRST_NORM_OPTAB];
if (d->libcall_gen == NULL)
return NULL;
d->libcall_gen (optab, d->libcall_basename, d->libcall_suffix, mode);
slot = libfunc_hash->find_slot (&e, NO_INSERT);
if (!slot)
return NULL;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
}
return (*slot)->libfunc;
}
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 the last insn or 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. */
1991-12-30 04:19:53 +01:00
static int
Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ 2014-08-28 David Malcolm <dmalcolm@redhat.com> * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise for local "insn". (define_expand "umulsi3_highpart"): Likewise for local "insn". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_insn): Likewise. (prev_nonnote_nondebug_insn): Likewise. (next_real_insn): Likewise. (prev_real_insn): Likewise. (next_active_insn): Likewise. (prev_active_insn): Likewise. (next_cc0_user): Likewise. Use rtx_sequence and a method for clarity. (prev_cc0_setter): Likewise. (try_split): Rename param "trial" to "uncast_trial" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping checked casts made redundant by this change. Strengthen locals "seq", "tem", "insn_last", "insn", "next" from rtx to rtx_insn *. (remove_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. (emit_pattern_after_setloc): Likewise for param "after", as "uncast_after". (emit_pattern_after): Likewise. Strengthen local "prev" from rtx to rtx_insn *. (emit_pattern_before_setloc): Rename param "before" to "uncast_before" and reintroduce "before" as a local rtx_insn * using a checked cast. Strengthen locals "first", "last" from rtx to rtx_insn *. (emit_pattern_before): Likewise rename/cast param "before" to "uncast_before". Strengthen local "next" from rtx to rtx_insn *. * except.c (copy_reg_eh_region_note_forward): Strengthen param "first" and local "insn" from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise for param "last" and local "insn". * expr.c (fixup_args_size_notes): Rename param "last" to "uncast_last" and reintroduce "last" as a local rtx_insn * using a checked cast. Strengthen local "insn" from rtx to rtx_insn *. * function.c (set_insn_locations): Strengthen param "insn" from rtx to rtx_insn *. (record_insns): Likewise for param "insns" and local "tmp". (active_insn_between): Rename param "tail" to "uncast_tail" and reintroduce "tail" as a local rtx_insn * using a checked cast. (thread_prologue_and_epilogue_insns): Split out top-level local rtx "seq" into three different rtx_insn * locals. Strengthen local "prologue_seq" from rtx to rtx_insn *. * gcse.c (insert_insn_end_basic_block): Strenghen local "insn" from rtx to rtx_insn *. * haifa-sched.c (initiate_bb_reg_pressure_info): Likewise. (priority): Likewise for locals "prev_first", "twin". (setup_insn_max_reg_pressure): Likewise for param "after". (sched_setup_bb_reg_pressure_info): Likewise. (no_real_insns_p): Strengthen params from const_rtx to const rtx_insn *. (schedule_block): Strengthen local "next_tail" from rtx to rtx_insn *. * ifcvt.c (find_active_insn_before): Strengthen return type and param "insn" from rtx to rtx_insn *. (find_active_insn_after): Likewise. (cond_exec_process_insns): Likewise for param "start" and local "insn". (cond_exec_process_if_block): Likewise for locals "then_start", "then_end", "else_start", "else_end", "insn", "start", "end", "from". (noce_process_if_block): Likewise for local "jump". (merge_if_block): Likewise for two locals named "end". (cond_exec_find_if_block): Likewise for local "last_insn". * jump.c (delete_related_insns): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. Strengthen local "p" from rtx to rtx_insn *. * lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with NULL. (split_reg): Likewise. * lra.c (lra_process_new_insns): Likewise. * modulo-sched.c (permute_partial_schedule): Strengthen param "last" from rtx to rtx_insn *. * optabs.c (add_equal_note): Likewise for param "insns" and local "last_insn". (expand_binop_directly): Add checked casts to rtx_insn * within NEXT_INSN (pat) uses. (expand_unop_direct): Likewise. (maybe_emit_unop_insn): Likewise. * recog.c (peep2_attempt): Strengthen locals "last", "before_try", "x" from rtx to rtx_insn *. * reorg.c (optimize_skip): Strengthen return type and local "delay_list" from rtx to rtx_insn_list *. Strengthen param "insn" and locals "trial", "next_trial" from rtx to rtx_insn *. * resource.c (next_insn_no_annul): Strengthen return type and param "insn" from rtx to rtx_insn *. Use a cast to and method of rtx_sequence to clarify the code. (mark_referenced_resources): Add a checked cast to rtx_insn * within PREV_INSN (x). (find_dead_or_set_registers): Strengthen return type, param "target", locals "insn", "next", "jump_insn", "this_jump_insn" from rtx to rtx_insn *. Strengthen param "jump_target" from rtx * to rtx_insn **. (mark_target_live_regs): Strengthen params "insns" and "target", locals "insn", "jump_target", "start_insn", "stop_insn" from rtx to rtx_insn *. Use cast to and method of rtx_sequence to clarify the code. * resource.h (mark_target_live_regs): Strengthen params 1 and 2 from rtx to rtx_insn *. * rtl.h (copy_reg_eh_region_note_forward): Strengthen second param from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise. (unshare_all_rtl_in_chain): Likewise for sole param. (dump_rtl_slim): Strengthen second and third params from const_rtx to const rtx_insn *. * sched-deps.c (sched_free_deps): Strengthen params "head" and "tail" and locals "insn", "next_tail" from rtx to rtx_insn *. * sched-ebb.c (init_ready_list): Strengthen locals "prev_head", "next_tail" from rtx to rtx_insn *. (begin_move_insn): Likewise for local "next". * sched-int.h (sched_free_deps): Likewise for first and second params. (no_real_insns_p): Strengthen both params from const_rtx to const rtx_insn *. (sched_setup_bb_reg_pressure_info): Strengthen second params from rtx to rtx_insn *. * sched-rgn.c (init_ready_list): Likewise for locals "prev_head", "next_tail". * sched-vis.c (dump_rtl_slim): Strengthen params "first", "last" and locals "insn", "tail" from const_rtx to const rtx_insn *. (rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to rtx_insn *. (debug_rtl_slim): Strengthen params "first" and "last" from const_rtx to const rtx_insn *. * shrink-wrap.c (try_shrink_wrapping): Strengthen param "prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *. (convert_to_simple_return): Likewise for param "returnjump". * shrink-wrap.h (try_shrink_wrapping): Likewise for param "prologue_seq". (convert_to_simple_return): Likewise for param "returnjump". * valtrack.c (propagate_for_debug): Likewise for params "insn", "last". * valtrack.h (propagate_for_debug): Likewise for second param. From-SVN: r214693
2014-08-28 22:45:40 +02:00
add_equal_note (rtx_insn *insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
1991-12-30 04:19:53 +01:00
{
Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ 2014-08-28 David Malcolm <dmalcolm@redhat.com> * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise for local "insn". (define_expand "umulsi3_highpart"): Likewise for local "insn". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_insn): Likewise. (prev_nonnote_nondebug_insn): Likewise. (next_real_insn): Likewise. (prev_real_insn): Likewise. (next_active_insn): Likewise. (prev_active_insn): Likewise. (next_cc0_user): Likewise. Use rtx_sequence and a method for clarity. (prev_cc0_setter): Likewise. (try_split): Rename param "trial" to "uncast_trial" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping checked casts made redundant by this change. Strengthen locals "seq", "tem", "insn_last", "insn", "next" from rtx to rtx_insn *. (remove_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. (emit_pattern_after_setloc): Likewise for param "after", as "uncast_after". (emit_pattern_after): Likewise. Strengthen local "prev" from rtx to rtx_insn *. (emit_pattern_before_setloc): Rename param "before" to "uncast_before" and reintroduce "before" as a local rtx_insn * using a checked cast. Strengthen locals "first", "last" from rtx to rtx_insn *. (emit_pattern_before): Likewise rename/cast param "before" to "uncast_before". Strengthen local "next" from rtx to rtx_insn *. * except.c (copy_reg_eh_region_note_forward): Strengthen param "first" and local "insn" from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise for param "last" and local "insn". * expr.c (fixup_args_size_notes): Rename param "last" to "uncast_last" and reintroduce "last" as a local rtx_insn * using a checked cast. Strengthen local "insn" from rtx to rtx_insn *. * function.c (set_insn_locations): Strengthen param "insn" from rtx to rtx_insn *. (record_insns): Likewise for param "insns" and local "tmp". (active_insn_between): Rename param "tail" to "uncast_tail" and reintroduce "tail" as a local rtx_insn * using a checked cast. (thread_prologue_and_epilogue_insns): Split out top-level local rtx "seq" into three different rtx_insn * locals. Strengthen local "prologue_seq" from rtx to rtx_insn *. * gcse.c (insert_insn_end_basic_block): Strenghen local "insn" from rtx to rtx_insn *. * haifa-sched.c (initiate_bb_reg_pressure_info): Likewise. (priority): Likewise for locals "prev_first", "twin". (setup_insn_max_reg_pressure): Likewise for param "after". (sched_setup_bb_reg_pressure_info): Likewise. (no_real_insns_p): Strengthen params from const_rtx to const rtx_insn *. (schedule_block): Strengthen local "next_tail" from rtx to rtx_insn *. * ifcvt.c (find_active_insn_before): Strengthen return type and param "insn" from rtx to rtx_insn *. (find_active_insn_after): Likewise. (cond_exec_process_insns): Likewise for param "start" and local "insn". (cond_exec_process_if_block): Likewise for locals "then_start", "then_end", "else_start", "else_end", "insn", "start", "end", "from". (noce_process_if_block): Likewise for local "jump". (merge_if_block): Likewise for two locals named "end". (cond_exec_find_if_block): Likewise for local "last_insn". * jump.c (delete_related_insns): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. Strengthen local "p" from rtx to rtx_insn *. * lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with NULL. (split_reg): Likewise. * lra.c (lra_process_new_insns): Likewise. * modulo-sched.c (permute_partial_schedule): Strengthen param "last" from rtx to rtx_insn *. * optabs.c (add_equal_note): Likewise for param "insns" and local "last_insn". (expand_binop_directly): Add checked casts to rtx_insn * within NEXT_INSN (pat) uses. (expand_unop_direct): Likewise. (maybe_emit_unop_insn): Likewise. * recog.c (peep2_attempt): Strengthen locals "last", "before_try", "x" from rtx to rtx_insn *. * reorg.c (optimize_skip): Strengthen return type and local "delay_list" from rtx to rtx_insn_list *. Strengthen param "insn" and locals "trial", "next_trial" from rtx to rtx_insn *. * resource.c (next_insn_no_annul): Strengthen return type and param "insn" from rtx to rtx_insn *. Use a cast to and method of rtx_sequence to clarify the code. (mark_referenced_resources): Add a checked cast to rtx_insn * within PREV_INSN (x). (find_dead_or_set_registers): Strengthen return type, param "target", locals "insn", "next", "jump_insn", "this_jump_insn" from rtx to rtx_insn *. Strengthen param "jump_target" from rtx * to rtx_insn **. (mark_target_live_regs): Strengthen params "insns" and "target", locals "insn", "jump_target", "start_insn", "stop_insn" from rtx to rtx_insn *. Use cast to and method of rtx_sequence to clarify the code. * resource.h (mark_target_live_regs): Strengthen params 1 and 2 from rtx to rtx_insn *. * rtl.h (copy_reg_eh_region_note_forward): Strengthen second param from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise. (unshare_all_rtl_in_chain): Likewise for sole param. (dump_rtl_slim): Strengthen second and third params from const_rtx to const rtx_insn *. * sched-deps.c (sched_free_deps): Strengthen params "head" and "tail" and locals "insn", "next_tail" from rtx to rtx_insn *. * sched-ebb.c (init_ready_list): Strengthen locals "prev_head", "next_tail" from rtx to rtx_insn *. (begin_move_insn): Likewise for local "next". * sched-int.h (sched_free_deps): Likewise for first and second params. (no_real_insns_p): Strengthen both params from const_rtx to const rtx_insn *. (sched_setup_bb_reg_pressure_info): Strengthen second params from rtx to rtx_insn *. * sched-rgn.c (init_ready_list): Likewise for locals "prev_head", "next_tail". * sched-vis.c (dump_rtl_slim): Strengthen params "first", "last" and locals "insn", "tail" from const_rtx to const rtx_insn *. (rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to rtx_insn *. (debug_rtl_slim): Strengthen params "first" and "last" from const_rtx to const rtx_insn *. * shrink-wrap.c (try_shrink_wrapping): Strengthen param "prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *. (convert_to_simple_return): Likewise for param "returnjump". * shrink-wrap.h (try_shrink_wrapping): Likewise for param "prologue_seq". (convert_to_simple_return): Likewise for param "returnjump". * valtrack.c (propagate_for_debug): Likewise for params "insn", "last". * valtrack.h (propagate_for_debug): Likewise for second param. From-SVN: r214693
2014-08-28 22:45:40 +02:00
rtx_insn *last_insn;
rtx set;
1991-12-30 04:19:53 +01:00
rtx note;
gcc_assert (insns && INSN_P (insns) && NEXT_INSN (insns));
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
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))
;
/* If TARGET is in OP0 or OP1, punt. We'd end up with a note referencing
a value changing in the insn, so the note would be invalid for CSE. */
if (reg_overlap_mentioned_p (target, op0)
|| (op1 && reg_overlap_mentioned_p (target, op1)))
{
if (MEM_P (target)
&& (rtx_equal_p (target, op0)
|| (op1 && rtx_equal_p (target, op1))))
{
/* For MEM target, with MEM = MEM op X, prefer no REG_EQUAL note
over expanding it as temp = MEM op X, MEM = temp. If the target
supports MEM = MEM op X instructions, it is sometimes too hard
to reconstruct that form later, especially if X is also a memory,
and due to multiple occurrences of addresses the address might
be forced into register unnecessarily.
Note that not emitting the REG_EQUIV note might inhibit
CSE in some cases. */
set = single_set (last_insn);
if (set
&& GET_CODE (SET_SRC (set)) == code
&& MEM_P (SET_DEST (set))
&& (rtx_equal_p (SET_DEST (set), XEXP (SET_SRC (set), 0))
|| (op1 && rtx_equal_p (SET_DEST (set),
XEXP (SET_SRC (set), 1)))))
return 1;
}
return 0;
}
set = set_for_reg_notes (last_insn);
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 (set == NULL_RTX)
return 1;
if (! rtx_equal_p (SET_DEST (set), target)
/* 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
|| ! rtx_equal_p (XEXP (SET_DEST (set), 0), target)))
1991-12-30 04:19:53 +01:00
return 1;
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)
switch (code)
{
case FFS:
case CLZ:
case CTZ:
case CLRSB:
case POPCOUNT:
case PARITY:
case BSWAP:
if (GET_MODE (op0) != VOIDmode && GET_MODE (target) != GET_MODE (op0))
{
note = gen_rtx_fmt_e (code, GET_MODE (op0), copy_rtx (op0));
if (GET_MODE_SIZE (GET_MODE (op0))
> GET_MODE_SIZE (GET_MODE (target)))
note = simplify_gen_unary (TRUNCATE, GET_MODE (target),
note, GET_MODE (op0));
else
note = simplify_gen_unary (ZERO_EXTEND, GET_MODE (target),
note, GET_MODE (op0));
break;
}
/* FALLTHRU */
default:
note = gen_rtx_fmt_e (code, GET_MODE (target), copy_rtx (op0));
break;
}
1991-12-30 04:19:53 +01:00
else
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;
}
/* Given two input operands, OP0 and OP1, determine what the correct from_mode
for a widening operation would be. In most cases this would be OP0, but if
that's a constant it'll be VOIDmode, which isn't useful. */
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
static machine_mode
widened_mode (machine_mode to_mode, rtx op0, rtx op1)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode m0 = GET_MODE (op0);
machine_mode m1 = GET_MODE (op1);
machine_mode result;
if (m0 == VOIDmode && m1 == VOIDmode)
return to_mode;
else if (m0 == VOIDmode || GET_MODE_SIZE (m0) < GET_MODE_SIZE (m1))
result = m1;
else
result = m0;
if (GET_MODE_SIZE (result) > GET_MODE_SIZE (to_mode))
return to_mode;
return result;
}
/* Like optab_handler, but for widening_operations that have a
TO_MODE and a FROM_MODE. */
enum insn_code
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
widening_optab_handler (optab op, machine_mode to_mode,
machine_mode from_mode)
{
unsigned scode = (op << 16) | to_mode;
if (to_mode != from_mode && from_mode != VOIDmode)
{
/* ??? Why does find_widening_optab_handler_and_mode attempt to
widen things that can't be widened? E.g. add_optab... */
if (op > LAST_CONV_OPTAB)
return CODE_FOR_nothing;
scode |= from_mode << 8;
}
return raw_optab_handler (scode);
}
/* Find a widening optab even if it doesn't widen as much as we want.
E.g. if from_mode is HImode, and to_mode is DImode, and there is no
direct HI->SI insn, then return SI->DI, if that exists.
If PERMIT_NON_WIDENING is non-zero then this can be used with
non-widening optabs also. */
enum insn_code
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
find_widening_optab_handler_and_mode (optab op, machine_mode to_mode,
machine_mode from_mode,
int permit_non_widening,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode *found_mode)
{
for (; (permit_non_widening || from_mode != to_mode)
&& GET_MODE_SIZE (from_mode) <= GET_MODE_SIZE (to_mode)
&& from_mode != VOIDmode;
from_mode = GET_MODE_WIDER_MODE (from_mode))
{
enum insn_code handler = widening_optab_handler (op, to_mode,
from_mode);
if (handler != CODE_FOR_nothing)
{
if (found_mode)
*found_mode = from_mode;
return handler;
}
}
return CODE_FOR_nothing;
}
/* 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
not actually do a sign-extend or zero-extend, but can leave the
higher-order bits of the result rtx undefined, for example, in the case
of logical operations, but not right shifts. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
widen_operand (rtx op, machine_mode mode, machine_mode oldmode,
int unsignedp, int no_extend)
{
rtx result;
/* 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. */
if (! no_extend
|| (GET_CODE (op) == SUBREG && SUBREG_PROMOTED_VAR_P (op)
calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET. gcc/ 2014-08-08 Kugan Vivekanandarajah <kuganv@linaro.org> * calls.c (precompute_arguments): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET. (expand_call): Likewise. * cfgexpand.c (expand_gimple_stmt_1): Use SUBREG_PROMOTED_SIGN to get promoted mode. * combine.c (record_promoted_value): Skip > 0 comparison with SUBREG_PROMOTED_UNSIGNED_P as it now returns only 0 or 1. * expr.c (convert_move): Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P. (convert_modes): Likewise. (store_expr): Use SUBREG_PROMOTED_SIGN to get promoted mode. Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P. (expand_expr_real_1): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET. * function.c (assign_parm_setup_reg): Use new SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET. * ifcvt.c (noce_emit_cmove): Updated to use SUBREG_PROMOTED_GET and SUBREG_PROMOTED_SET. * internal-fn.c (ubsan_expand_si_overflow_mul_check): Use SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_SET. * optabs.c (widen_operand): Use SUBREG_CHECK_PROMOTED_SIGN instead of SUBREG_PROMOTED_UNSIGNED_P. * rtl.h (SUBREG_PROMOTED_UNSIGNED_SET): Remove. (SUBREG_PROMOTED_SET): New define. (SUBREG_PROMOTED_GET): Likewise. (SUBREG_PROMOTED_SIGN): Likewise. (SUBREG_PROMOTED_SIGNED_P): Likewise. (SUBREG_CHECK_PROMOTED_SIGN): Likewise. (SUBREG_PROMOTED_UNSIGNED_P): Updated. * rtlanal.c (unsigned_reg_p): Use new SUBREG_PROMOTED_GET instead of SUBREG_PROMOTED_UNSIGNED_GET. (nonzero_bits1): Skip > 0 comparison with the results as SUBREG_PROMOTED_UNSIGNED_P now returns only 0 or 1. (num_sign_bit_copies1): Use SUBREG_PROMOTED_SIGNED_P instead of !SUBREG_PROMOTED_UNSIGNED_P. * simplify-rtx.c (simplify_unary_operation_1): Use new SUBREG_PROMOTED_SIGNED_P instead of !SUBREG_PROMOTED_UNSIGNED_P. (simplify_subreg): Use new SUBREG_PROMOTED_SIGNED_P, SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_SET instead of SUBREG_PROMOTED_UNSIGNED_P and SUBREG_PROMOTED_UNSIGNED_SET. From-SVN: r213749
2014-08-08 07:24:12 +02:00
&& SUBREG_CHECK_PROMOTED_SIGN (op, unsignedp)))
return convert_modes (mode, oldmode, op, unsignedp);
/* If MODE is no wider than a single word, we return a lowpart or paradoxical
SUBREG. */
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
return gen_lowpart (mode, force_reg (GET_MODE (op), op));
/* Otherwise, get an object of MODE, clobber it, and set the low-order
part to OP. */
result = gen_reg_rtx (mode);
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_clobber (result);
emit_move_insn (gen_lowpart (GET_MODE (op), result), op);
return result;
}
/* Return the optab used for computing the operation given by the tree code,
CODE and the tree EXP. This function is not always usable (for example, it
cannot give complete results for multiplication or division) but probably
ought to be relied on more widely throughout the expander. */
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
optab
optab_for_tree_code (enum tree_code code, const_tree type,
enum optab_subtype subtype)
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
{
bool trapv;
switch (code)
{
case BIT_AND_EXPR:
return and_optab;
case BIT_IOR_EXPR:
return ior_optab;
case BIT_NOT_EXPR:
return one_cmpl_optab;
case BIT_XOR_EXPR:
return xor_optab;
case MULT_HIGHPART_EXPR:
return TYPE_UNSIGNED (type) ? umul_highpart_optab : smul_highpart_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
case TRUNC_MOD_EXPR:
case CEIL_MOD_EXPR:
case FLOOR_MOD_EXPR:
case ROUND_MOD_EXPR:
return TYPE_UNSIGNED (type) ? umod_optab : smod_optab;
case RDIV_EXPR:
case TRUNC_DIV_EXPR:
case CEIL_DIV_EXPR:
case FLOOR_DIV_EXPR:
case ROUND_DIV_EXPR:
case EXACT_DIV_EXPR:
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usdiv_optab : ssdiv_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return TYPE_UNSIGNED (type) ? udiv_optab : sdiv_optab;
case LSHIFT_EXPR:
if (TREE_CODE (type) == VECTOR_TYPE)
{
if (subtype == optab_vector)
return TYPE_SATURATING (type) ? unknown_optab : vashl_optab;
gcc_assert (subtype == optab_scalar);
}
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usashl_optab : ssashl_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return ashl_optab;
case RSHIFT_EXPR:
if (TREE_CODE (type) == VECTOR_TYPE)
{
if (subtype == optab_vector)
return TYPE_UNSIGNED (type) ? vlshr_optab : vashr_optab;
gcc_assert (subtype == optab_scalar);
}
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return TYPE_UNSIGNED (type) ? lshr_optab : ashr_optab;
case LROTATE_EXPR:
if (TREE_CODE (type) == VECTOR_TYPE)
{
if (subtype == optab_vector)
return vrotl_optab;
gcc_assert (subtype == optab_scalar);
}
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return rotl_optab;
case RROTATE_EXPR:
if (TREE_CODE (type) == VECTOR_TYPE)
{
if (subtype == optab_vector)
return vrotr_optab;
gcc_assert (subtype == optab_scalar);
}
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return rotr_optab;
case MAX_EXPR:
return TYPE_UNSIGNED (type) ? umax_optab : smax_optab;
case MIN_EXPR:
return TYPE_UNSIGNED (type) ? umin_optab : smin_optab;
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
case REALIGN_LOAD_EXPR:
return vec_realign_load_optab;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
case WIDEN_SUM_EXPR:
return TYPE_UNSIGNED (type) ? usum_widen_optab : ssum_widen_optab;
case DOT_PROD_EXPR:
return TYPE_UNSIGNED (type) ? udot_prod_optab : sdot_prod_optab;
case SAD_EXPR:
return TYPE_UNSIGNED (type) ? usad_optab : ssad_optab;
With large parts from Jim Wilson: PR target/43902 * tree-pretty-print.c (dump_generic_node, op_code_prio): Add WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * optabs.c (optab_for_tree_code): Likewise. (expand_widen_pattern_expr): Likewise. * tree-ssa-math-opts.c (convert_mult_to_widen): New function, broken out of execute_optimize_widening_mul. (convert_plusminus_to_widen): New function. (execute_optimize_widening_mul): Use the two new functions. * expr.c (expand_expr_real_2): Add support for GIMPLE_TERNARY_RHS. Remove code to generate widening multiply-accumulate. Add support for WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): New function. (dump_gimple_assign): Call it when appropriate. * tree.def (WIDEN_MULT_PLUS_EXPR, WIDEN_MULT_MINUS_EXPR): New codes. * cfgexpand.c (gimple_assign_rhs_to_tree): Likewise. (expand_gimple_stmt_1): Likewise. (expand_debug_expr): Support WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * gimple.c (extract_ops_from_tree_1): Renamed from extract_ops_from_tree. Add new arg for a third operand; fill it. (gimple_build_assign_stat): Support operations with three operands. (gimple_build_assign_with_ops_stat): Likewise. (gimple_assign_set_rhs_from_tree): Likewise. (gimple_assign_set_rhs_with_ops_1): Renamed from gimple_assign_set_rhs_with_ops. Add new arg for a third operand. (get_gimple_rhs_num_ops): Support GIMPLE_TERNARY_RHS. (get_gimple_rhs_num_ops): Handle WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple.h (enum gimple_rhs_class): Add GIMPLE_TERNARY_RHS. (extract_ops_from_tree_1): Adjust declaration. (gimple_assign_set_rhs_with_ops_1): Likewise. (gimple_build_assign_with_ops): Pass NULL for last operand. (gimple_build_assign_with_ops3): New macro. (gimple_assign_rhs3, gimple_assign_rhs3_ptr, gimple_assign_set_rhs3, gimple_assign_set_rhs_with_ops, extract_ops_from_tree): New inline functions. * tree-cfg.c (verify_gimple_assign_ternary): New static function. (verify_gimple_assign): Call it. * doc/gimple.texi (Manipulating operands): Document GIMPLE_TERNARY_RHS. (Tuple specific accessors, subsection GIMPLE_ASSIGN): Document new functions for dealing with three-operand statements. * tree.c (commutative_ternary_tree_code): New function. * tree.h (commutative_ternary_tree_code): Declare it. * tree-vrp.c (gimple_assign_nonnegative_warnv_p): Return false for ternary statements. (gimple_assign_nonzero_warnv_p): Likewise. * tree-ssa-sccvn.c (stmt_has_constants): Handle GIMPLE_TERNARY_RHS. * tree-ssa-ccp.c (get_rhs_assign_op_for_ccp): New static function. (ccp_fold): Use it. Handle GIMPLE_TERNARY_RHS. * tree-ssa-dom.c (enum expr_kind): Add EXPR_TERNARY. (struct hashtable_expr): New member ternary in the union. (initialize_hash_element): Handle GIMPLE_TERNARY_RHS. (hashable_expr_equal_p): Fix indentation. Handle EXPR_TERNARY. (iterative_hash_hashable_expr): Likewise. (print_expr_hash_elt): Handle EXPR_TERNARY. * gimple-fold.c (fold_gimple_assign): Handle GIMPLE_TERNARY_RHS. * tree-ssa-threadedge.c (fold_assignment_stmt): Remove useless break statements. Handle GIMPLE_TERNARY_RHS. testsuite/ PR target/43902 * gcc.target/mips/madd-9.c: New test. From-SVN: r161366
2010-06-25 10:56:24 +02:00
case WIDEN_MULT_PLUS_EXPR:
return (TYPE_UNSIGNED (type)
? (TYPE_SATURATING (type)
? usmadd_widen_optab : umadd_widen_optab)
: (TYPE_SATURATING (type)
? ssmadd_widen_optab : smadd_widen_optab));
case WIDEN_MULT_MINUS_EXPR:
return (TYPE_UNSIGNED (type)
? (TYPE_SATURATING (type)
? usmsub_widen_optab : umsub_widen_optab)
: (TYPE_SATURATING (type)
? ssmsub_widen_optab : smsub_widen_optab));
tree.def (FMA_EXPR): New tree code. 2010-11-04 Richard Guenther <rguenther@suse.de> Richard Henderson <rth@redhat.com> * tree.def (FMA_EXPR): New tree code. * expr.c (expand_expr_real_2): Add FMA_EXPR expansion code. * gimple.c (gimple_rhs_class_table): FMA_EXPR is a GIMPLE_TERNARY_RHS. * tree-cfg.c (verify_gimple_assign_ternary): Verify FMA_EXPR types. * tree-inline.c (estimate_operator_cost): Handle FMA_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): Likewise. * tree-ssa-math-opts.c (convert_mult_to_fma): New function. (execute_optimize_widening_mul): Call it. Reorganize to allow dead stmt removal. Move TODO flags ... (pass_optimize_widening_mul): ... here. * flag-types.h (enum fp_contract_mode): New enum. * common.opt (flag_fp_contract_mode): New variable. (-ffp-contract): New option. * opts.c (common_handle_option): Handle it. * doc/invoke.texi (-ffp-contract): Document. * tree.h (fold_fma): Declare. * builtins.c (fold_fma): New function. (fold_builtin_fma): Likewise. (fold_builtin_3): Call it for fma. * fold-const.c (fold_ternary_loc): Fold FMA_EXPR. * optabs.c (optab_for_tree_code): Handle FMA_EXPR. * config/i386/sse.md (fms<mode>4, fnma<mode>, fnms<mode>4): New expanders. * doc/md.texi (fms<mode>4, fnma<mode>, fnms<mode>4): Document new named patterns. * genopinit.c (optabs): Initialize fms_optab, fnma_optab and fnms_optab. * optabs.h (enum optab_index): Add OTI_fms, OTI_fnma and OTI_fnms. (fms_optab, fnma_optab, fnms_optab): New defines. * gimplify.c (gimplify_expr): Handle binary truth expressions explicitly. Handle FMA_EXPR. * tree-vect-stmts.c (vectorizable_operation): Handle ternary operations. * gcc.target/i386/fma4-vector-2.c: New testcase. Co-Authored-By: Richard Henderson <rth@redhat.com> From-SVN: r166304
2010-11-04 11:56:22 +01:00
case FMA_EXPR:
return fma_optab;
tree.def (REDUC_MAX_EXPR, [...]): New tree-codes. * tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New tree-codes. * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, reduc_plus_optab): New optabs for reduction. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle new tree-codes. * optabs.c (optab_for_tree_code): Handle new tree-codes. (init_optabs): Initialize new optabs. * genopinit.c (optabs): Define handlers for new optabs. * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in case of a phi that is marked as relevant. Call vectorizable_reduction. (vect_mark_relevant): Phis may be marked as relevant. (vect_mark_stmts_to_be_vectorized): The use corresponding to the reduction variable in a reduction stmt does not mark its defining phi as relevant. Update documentation accordingly. (vect_can_advance_ivs_p): Skip reduction phis. * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes additional argument. Handle reduction. (vect_create_destination_var): Update call to vect_get_new_vect_var. Handle non-vector argument. (get_initial_def_for_reduction): New function. (vect_create_epilog_for_reduction): New function. (vectorizable_reduction): New function. (vect_get_new_vect_var): Handle new vect_var_kind. (vectorizable_assignment, vectorizable_operation, vectorizable_store, vectorizable_condition): Update call to vect_get_new_vect_var. (vect_transform_stmt): Call vectorizable_reduction. (vect_update_ivs_after_vectorizer): Skip reduction phis. (vect_transform_loop): Skip if stmt is both not relevant and not live. * tree-vectorizer.c (reduction_code_for_scalar_code): New function. (vect_is_simple_reduction): Was empty - added implementation. * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. (reduc_vec_info_type): New enum vect_def_type value. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, reduc_plus_v4si, reduc_plus_v4sf): New define_expands. * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove ENABLE_CHECKING around gcc_assert. * tree-vect-transform.c (vect_do_peeling_for_loop_bound, (vect_do_peeling_for_alignment, vect_transform_loop, vect_get_vec_def_for_operand): Likewise. From-SVN: r101155
2005-06-18 15:18:52 +02:00
case REDUC_MAX_EXPR:
return TYPE_UNSIGNED (type)
? reduc_umax_scal_optab : reduc_smax_scal_optab;
tree.def (REDUC_MAX_EXPR, [...]): New tree-codes. * tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New tree-codes. * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, reduc_plus_optab): New optabs for reduction. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle new tree-codes. * optabs.c (optab_for_tree_code): Handle new tree-codes. (init_optabs): Initialize new optabs. * genopinit.c (optabs): Define handlers for new optabs. * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in case of a phi that is marked as relevant. Call vectorizable_reduction. (vect_mark_relevant): Phis may be marked as relevant. (vect_mark_stmts_to_be_vectorized): The use corresponding to the reduction variable in a reduction stmt does not mark its defining phi as relevant. Update documentation accordingly. (vect_can_advance_ivs_p): Skip reduction phis. * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes additional argument. Handle reduction. (vect_create_destination_var): Update call to vect_get_new_vect_var. Handle non-vector argument. (get_initial_def_for_reduction): New function. (vect_create_epilog_for_reduction): New function. (vectorizable_reduction): New function. (vect_get_new_vect_var): Handle new vect_var_kind. (vectorizable_assignment, vectorizable_operation, vectorizable_store, vectorizable_condition): Update call to vect_get_new_vect_var. (vect_transform_stmt): Call vectorizable_reduction. (vect_update_ivs_after_vectorizer): Skip reduction phis. (vect_transform_loop): Skip if stmt is both not relevant and not live. * tree-vectorizer.c (reduction_code_for_scalar_code): New function. (vect_is_simple_reduction): Was empty - added implementation. * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. (reduc_vec_info_type): New enum vect_def_type value. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, reduc_plus_v4si, reduc_plus_v4sf): New define_expands. * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove ENABLE_CHECKING around gcc_assert. * tree-vect-transform.c (vect_do_peeling_for_loop_bound, (vect_do_peeling_for_alignment, vect_transform_loop, vect_get_vec_def_for_operand): Likewise. From-SVN: r101155
2005-06-18 15:18:52 +02:00
case REDUC_MIN_EXPR:
return TYPE_UNSIGNED (type)
? reduc_umin_scal_optab : reduc_smin_scal_optab;
tree.def (REDUC_MAX_EXPR, [...]): New tree-codes. * tree.def (REDUC_MAX_EXPR, REDUC_MIN_EXPR, REDUC_PLUS_EXPR): New tree-codes. * optabs.h (OTI_reduc_smax, OTI_reduc_umax, OTI_reduc_smin, OTI_reduc_umin, OTI_reduc_plus): New optabs for reduction. (reduc_smax_optab, reduc_umax_optab, reduc_smin_optab, reduc_umin_optab, reduc_plus_optab): New optabs for reduction. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio, op_symbol): Handle new tree-codes. * optabs.c (optab_for_tree_code): Handle new tree-codes. (init_optabs): Initialize new optabs. * genopinit.c (optabs): Define handlers for new optabs. * tree-vect-analyze.c (vect_analyze_operations): Fail vectorization in case of a phi that is marked as relevant. Call vectorizable_reduction. (vect_mark_relevant): Phis may be marked as relevant. (vect_mark_stmts_to_be_vectorized): The use corresponding to the reduction variable in a reduction stmt does not mark its defining phi as relevant. Update documentation accordingly. (vect_can_advance_ivs_p): Skip reduction phis. * tree-vect-transform.c (vect_get_vec_def_for_operand): Takes additional argument. Handle reduction. (vect_create_destination_var): Update call to vect_get_new_vect_var. Handle non-vector argument. (get_initial_def_for_reduction): New function. (vect_create_epilog_for_reduction): New function. (vectorizable_reduction): New function. (vect_get_new_vect_var): Handle new vect_var_kind. (vectorizable_assignment, vectorizable_operation, vectorizable_store, vectorizable_condition): Update call to vect_get_new_vect_var. (vect_transform_stmt): Call vectorizable_reduction. (vect_update_ivs_after_vectorizer): Skip reduction phis. (vect_transform_loop): Skip if stmt is both not relevant and not live. * tree-vectorizer.c (reduction_code_for_scalar_code): New function. (vect_is_simple_reduction): Was empty - added implementation. * tree-vectorizer.h (vect_scalar_var): New enum vect_var_kind value. (reduc_vec_info_type): New enum vect_def_type value. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_umin_v4sf, reduc_smin_v4sf, reduc_plus_v4si, reduc_plus_v4sf): New define_expands. * tree-vect-analyze.c (vect_determine_vectorization_factor): Remove ENABLE_CHECKING around gcc_assert. * tree-vect-transform.c (vect_do_peeling_for_loop_bound, (vect_do_peeling_for_alignment, vect_transform_loop, vect_get_vec_def_for_operand): Likewise. From-SVN: r101155
2005-06-18 15:18:52 +02:00
case REDUC_PLUS_EXPR:
return reduc_plus_scal_optab;
genopinit.c (vec_shl_optab, [...]): Initialize new optabs. * genopinit.c (vec_shl_optab, vec_shr_optab): Initialize new optabs. (reduc_plus_optab): Removed. Replcaed with... (reduc_splus_optab, reduc_uplus_optab): Initialize new optabs. * optabs.c (optab_for_tree_code): Return reduc_splus_optab or reduc_uplus_optab instead of reduc_plus_optab. (expand_vec_shift_expr): New function. (init_optabs): Initialize new optabs. Remove initialization of reduc_plus_optab. (optab_for_tree_code): Return vec_shl_optab/vec_shr_optab for VEC_LSHIFT_EXPR/VEC_RSHIFT_EXPR. * optabs.h (OTI_reduc_plus): Removed. Replaced with... (OTI_reduc_splus, OTI_reduc_uplus): New. (reduc_plus_optab): Removed. Replcaed with... (reduc_splus_optab, reduc_uplus_optab): New optabs. (vec_shl_optab, vec_shr_optab): New optabs. (expand_vec_shift_expr): New function declaration. * tree.def (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Handle new tree-codes. * expr.c (expand_expr_real_1): Handle new tree-codes. * tree-pretty-print.c (dump_generic_node, op_symbol, op_prio): Likewise. * tree-vect-generic.c (expand_vector_operations_1): Add assert. * tree-vect-transform.c (vect_create_epilog_for_reduction): Add two alternatives for generating reduction epilog code. (vectorizable_reduction): Don't fail of direct reduction support is not available. (vectorizable_target_reduction_pattern): Likewise. * config/rs6000/altivec.md (reduc_smax_v4si, reduc_smax_v4sf, reduc_umax_v4si, reduc_smin_v4si, reduc_smin_v4sf, reduc_umin_v4si, reduc_plus_v4si, reduc_plus_v4sf): Removed. (vec_shl_<mode>, vec_shr_<mode>, altivec_vsumsws_nomode, reduc_splus_<mode>, reduc_uplus_v16qi): New. From-SVN: r101231
2005-06-21 11:02:00 +02:00
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
case VEC_WIDEN_MULT_HI_EXPR:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return TYPE_UNSIGNED (type) ?
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
vec_widen_umult_hi_optab : vec_widen_smult_hi_optab;
case VEC_WIDEN_MULT_LO_EXPR:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return TYPE_UNSIGNED (type) ?
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
vec_widen_umult_lo_optab : vec_widen_smult_lo_optab;
case VEC_WIDEN_MULT_EVEN_EXPR:
return TYPE_UNSIGNED (type) ?
vec_widen_umult_even_optab : vec_widen_smult_even_optab;
case VEC_WIDEN_MULT_ODD_EXPR:
return TYPE_UNSIGNED (type) ?
vec_widen_umult_odd_optab : vec_widen_smult_odd_optab;
md.texi (vec_widen_ushiftl_hi, [...]): Document. * doc/md.texi (vec_widen_ushiftl_hi, vec_widen_ushiftl_lo, vec_widen_sshiftl_hi, vec_widen_sshiftl_lo): Document. * tree-pretty-print.c (dump_generic_node): Handle WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (op_code_prio): Likewise. (op_symbol_code): Handle WIDEN_LSHIFT_EXPR. * optabs.c (optab_for_tree_code): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. (init-optabs): Initialize optab codes for vec_widen_u/sshiftl_hi/lo. * optabs.h (enum optab_index): Add OTI_vec_widen_u/sshiftl_hi/lo. * genopinit.c (optabs): Initialize the new optabs. * expr.c (expand_expr_real_2): Handle VEC_WIDEN_LSHIFT_HI_EXPR and VEC_WIDEN_LSHIFT_LO_EXPR. * gimple-pretty-print.c (dump_binary_rhs): Likewise. * tree-vectorizer.h (NUM_PATTERNS): Increase to 8. * tree.def (WIDEN_LSHIFT_EXPR, VEC_WIDEN_LSHIFT_HI_EXPR, VEC_WIDEN_LSHIFT_LO_EXPR): New. * cfgexpand.c (expand_debug_expr): Handle new tree codes. * tree-vect-patterns.c (vect_vect_recog_func_ptrs): Add vect_recog_widen_shift_pattern. (vect_handle_widen_mult_by_const): Rename... (vect_handle_widen_op_by_const): ...to this. Handle shifts. Add a new argument, update documentation. (vect_recog_widen_mult_pattern): Assume that only second operand can be constant. Update call to vect_handle_widen_op_by_const. (vect_recog_over_widening_pattern): Fix typo. (vect_recog_widen_shift_pattern): New. * tree-vect-stmts.c (vectorizable_type_promotion): Handle widening shifts. (supportable_widening_operation): Likewise. * tree-inline.c (estimate_operator_cost): Handle new tree codes. * tree-vect-generic.c (expand_vector_operations_1): Likewise. * tree-cfg.c (verify_gimple_assign_binary): Likewise. * config/arm/neon.md (neon_vec_<US>shiftl_<mode>): New. (vec_widen_<US>shiftl_lo_<mode>, neon_vec_<US>shiftl_hi_<mode>, vec_widen_<US>shiftl_hi_<mode>, neon_vec_<US>shift_left_<mode>): Likewise. * config/arm/predicates.md (const_neon_scalar_shift_amount_operand): New. * config/arm/iterators.md (V_innermode): New. * tree-vect-slp.c (vect_build_slp_tree): Require same shift operand for widening shift. From-SVN: r180128
2011-10-18 11:39:04 +02:00
case VEC_WIDEN_LSHIFT_HI_EXPR:
return TYPE_UNSIGNED (type) ?
vec_widen_ushiftl_hi_optab : vec_widen_sshiftl_hi_optab;
case VEC_WIDEN_LSHIFT_LO_EXPR:
return TYPE_UNSIGNED (type) ?
vec_widen_ushiftl_lo_optab : vec_widen_sshiftl_lo_optab;
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
case VEC_UNPACK_HI_EXPR:
re PR tree-optimization/24659 (Conversions are not vectorized) 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * optabs.h (enum optab_index) [OTI_vec_unpacks_hi, OTI_vec_unpacks_lo]: Update comment to mention floating point operands. (vec_pack_trunc_optab): Rename from vec_pack_mod_optab. * genopinit.c (optabs): Rename vec_pack_mod_optab to vec_pack_trunc_optab. * tree-vect-transform.c (vectorizable_type_demotion): Do not fail early for scalar floating point operands for NOP_EXPR. (vectorizable_type_promotion): Ditto. * optabs.c (optab_for_tree_code) [VEC_PACK_TRUNC_EXPR]: Return vec_pack_trunc_optab. (expand_binop): Rename vec_float_trunc_optab to vec_pack_mod_optab. * tree.def (VEC_PACK_TRUNC_EXPR): Rename from VEC_PACK_MOD_EXPR. * tree-pretty-print.c (dump_generic_node) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. (op_prio) [VEC_PACK_TRUNC_EXPR]: Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_hi_v4sf): New expander. (vec_unpacks_lo_v4sf): Ditto. (vec_pack_trunc_v2df): Ditto. (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. (vec_pack_trunc_v2di): Rename from vec_pack_mod_v2di. * config/rs6000/altivec.md (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. * doc/c-tree.texi (Expression trees) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. This expression also represent packing of floating point operands. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR]: These expression also represent unpacking of floating point operands. * doc/md.texi (Standard Names) [vec_pack_trunc]: Update documentation. [vec_unpacks_hi]: Ditto. [vec_unpacks_lo]: Ditto. testsuite/ChangeLog: 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * gcc.dg/vect/vect-float-extend-1.c: New test. * gcc.dg/vect/vect-float-truncate-1.c: New test. From-SVN: r124045
2007-04-22 20:45:06 +02:00
return TYPE_UNSIGNED (type) ?
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
vec_unpacku_hi_optab : vec_unpacks_hi_optab;
case VEC_UNPACK_LO_EXPR:
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return TYPE_UNSIGNED (type) ?
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
vec_unpacku_lo_optab : vec_unpacks_lo_optab;
re PR tree-optimization/24659 (Conversions are not vectorized) PR tree-optimization/24659 * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi, OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi, OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and OTI_vec_pack_ufix_trunc. (vec_unpacks_float_hi_optab): Define new macro. (vec_unpacks_float_lo_optab): Ditto. (vec_unpacku_float_hi_optab): Ditto. (vec_unpacku_float_lo_optab): Ditto. (vec_pack_sfix_trunc_optab): Ditto. (vec_pack_ufix_trunc_optab): Ditto. * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[s|u]fix_trunc_optab using vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns * tree-vectorizer.c (supportable_widening_operation): Handle FLOAT_EXPR and CONVERT_EXPR. Update comment. (supportable_narrowing_operation): New function. * tree-vectorizer.h (supportable_narrowing_operation): Prototype. * tree-vect-transform.c (vectorizable_conversion): Handle (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases. (vect_gen_widened_results_half): Move before vectorizable_conversion. (vectorizable_type_demotion): Call supportable_narrowing_operation() to check for target support. * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab for VEC_PACK_FIX_TRUNC_EXPR. (expand_binop): Special case mode of the result for vec_pack_[u|s]fix_trunc_optab. (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[u|s]fix_trunc_optab. * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR, VEC_PACK_FIX_TRUNC_EXPR): New tree codes. * tree-pretty-print.c (dump_generic_node): Handle VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and VEC_PACK_FIX_TRUNC_EXPR. (op_prio): Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander. (vec_unpacks_float_lo_v8hi): Ditto. (vec_unpacku_float_hi_v8hi): Ditto. (vec_unpacku_float_lo_v8hi): Ditto. (vec_unpacks_float_hi_v4si): Ditto. (vec_unpacks_float_lo_v4si): Ditto. (vec_pack_sfix_trunc_v2df): Ditto. * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]: Document. [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto. [VEC_PACK_FIX_TRUNC_EXPR]: Ditto. * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document. [vec_pack_ufix_trunc]: Ditto. [vec_unpacks_float_hi]: Ditto. [vec_unpacks_float_lo]: Ditto. [vec_unpacku_float_hi]: Ditto. [vec_unpacku_float_lo]: Ditto. testsuite/ChangeLog: PR tree-optimization/24659 * gcc.dg/vect/vect-floatint-conversion-2.c: New test. * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float, not vect_int target. * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float, not vect_int target. Loop is vectorized for vect_intfloat_cvt targets. * gcc.dg/vect/vect-intfloat-conversion-3.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test. From-SVN: r124784
2007-05-17 08:31:05 +02:00
case VEC_UNPACK_FLOAT_HI_EXPR:
/* The signedness is determined from input operand. */
return TYPE_UNSIGNED (type) ?
vec_unpacku_float_hi_optab : vec_unpacks_float_hi_optab;
case VEC_UNPACK_FLOAT_LO_EXPR:
/* The signedness is determined from input operand. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
return TYPE_UNSIGNED (type) ?
re PR tree-optimization/24659 (Conversions are not vectorized) PR tree-optimization/24659 * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi, OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi, OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and OTI_vec_pack_ufix_trunc. (vec_unpacks_float_hi_optab): Define new macro. (vec_unpacks_float_lo_optab): Ditto. (vec_unpacku_float_hi_optab): Ditto. (vec_unpacku_float_lo_optab): Ditto. (vec_pack_sfix_trunc_optab): Ditto. (vec_pack_ufix_trunc_optab): Ditto. * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[s|u]fix_trunc_optab using vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns * tree-vectorizer.c (supportable_widening_operation): Handle FLOAT_EXPR and CONVERT_EXPR. Update comment. (supportable_narrowing_operation): New function. * tree-vectorizer.h (supportable_narrowing_operation): Prototype. * tree-vect-transform.c (vectorizable_conversion): Handle (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases. (vect_gen_widened_results_half): Move before vectorizable_conversion. (vectorizable_type_demotion): Call supportable_narrowing_operation() to check for target support. * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab for VEC_PACK_FIX_TRUNC_EXPR. (expand_binop): Special case mode of the result for vec_pack_[u|s]fix_trunc_optab. (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[u|s]fix_trunc_optab. * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR, VEC_PACK_FIX_TRUNC_EXPR): New tree codes. * tree-pretty-print.c (dump_generic_node): Handle VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and VEC_PACK_FIX_TRUNC_EXPR. (op_prio): Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander. (vec_unpacks_float_lo_v8hi): Ditto. (vec_unpacku_float_hi_v8hi): Ditto. (vec_unpacku_float_lo_v8hi): Ditto. (vec_unpacks_float_hi_v4si): Ditto. (vec_unpacks_float_lo_v4si): Ditto. (vec_pack_sfix_trunc_v2df): Ditto. * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]: Document. [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto. [VEC_PACK_FIX_TRUNC_EXPR]: Ditto. * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document. [vec_pack_ufix_trunc]: Ditto. [vec_unpacks_float_hi]: Ditto. [vec_unpacks_float_lo]: Ditto. [vec_unpacku_float_hi]: Ditto. [vec_unpacku_float_lo]: Ditto. testsuite/ChangeLog: PR tree-optimization/24659 * gcc.dg/vect/vect-floatint-conversion-2.c: New test. * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float, not vect_int target. * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float, not vect_int target. Loop is vectorized for vect_intfloat_cvt targets. * gcc.dg/vect/vect-intfloat-conversion-3.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test. From-SVN: r124784
2007-05-17 08:31:05 +02:00
vec_unpacku_float_lo_optab : vec_unpacks_float_lo_optab;
re PR tree-optimization/24659 (Conversions are not vectorized) 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * optabs.h (enum optab_index) [OTI_vec_unpacks_hi, OTI_vec_unpacks_lo]: Update comment to mention floating point operands. (vec_pack_trunc_optab): Rename from vec_pack_mod_optab. * genopinit.c (optabs): Rename vec_pack_mod_optab to vec_pack_trunc_optab. * tree-vect-transform.c (vectorizable_type_demotion): Do not fail early for scalar floating point operands for NOP_EXPR. (vectorizable_type_promotion): Ditto. * optabs.c (optab_for_tree_code) [VEC_PACK_TRUNC_EXPR]: Return vec_pack_trunc_optab. (expand_binop): Rename vec_float_trunc_optab to vec_pack_mod_optab. * tree.def (VEC_PACK_TRUNC_EXPR): Rename from VEC_PACK_MOD_EXPR. * tree-pretty-print.c (dump_generic_node) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. (op_prio) [VEC_PACK_TRUNC_EXPR]: Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_hi_v4sf): New expander. (vec_unpacks_lo_v4sf): Ditto. (vec_pack_trunc_v2df): Ditto. (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. (vec_pack_trunc_v2di): Rename from vec_pack_mod_v2di. * config/rs6000/altivec.md (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. * doc/c-tree.texi (Expression trees) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. This expression also represent packing of floating point operands. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR]: These expression also represent unpacking of floating point operands. * doc/md.texi (Standard Names) [vec_pack_trunc]: Update documentation. [vec_unpacks_hi]: Ditto. [vec_unpacks_lo]: Ditto. testsuite/ChangeLog: 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * gcc.dg/vect/vect-float-extend-1.c: New test. * gcc.dg/vect/vect-float-truncate-1.c: New test. From-SVN: r124045
2007-04-22 20:45:06 +02:00
case VEC_PACK_TRUNC_EXPR:
return vec_pack_trunc_optab;
[multiple changes] 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Take enum argument instead of bool. (vect_analyze_operations): Call vectorizable_type_promotion. * tree-vectorizer.h (type_promotion_vec_info_type): New enum stmt_vec_info_type value. (supportable_widening_operation, vectorizable_type_promotion): New function declarations. * tree-vect-transform.c (vect_gen_widened_results_half): New function. (vectorizable_type_promotion): New function. (vect_transform_stmt): Call vectorizable_type_promotion. * tree-vect-analyze.c (supportable_widening_operation): New function. * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Add implementation. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR): (VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Add cases for above new tree-codes. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. (init_optabs): Initialize new optabs. * genopinit.c (vec_widen_umult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_hi_optab, vec_widen_smult_lo_optab, vec_unpacks_hi_optab, vec_unpacks_lo_optab, vec_unpacku_hi_optab, vec_unpacku_lo_optab): Initialize new optabs. * optabs.h (OTI_vec_widen_umult_hi, OTI_vec_widen_umult_lo): (OTI_vec_widen_smult_h, OTI_vec_widen_smult_lo, OTI_vec_unpacks_hi, OTI_vec_unpacks_lo, OTI_vec_unpacku_hi, OTI_vec_unpacku_lo): New optab indices. (vec_widen_umult_hi_optab, vec_widen_umult_lo_optab): (vec_widen_smult_hi_optab, vec_widen_smult_lo_optab): (vec_unpacks_hi_optab, vec_unpacku_hi_optab, vec_unpacks_lo_optab): (vec_unpacku_lo_optab): New optabs. * doc/md.texi (vec_unpacks_hi, vec_unpacks_lo, vec_unpacku_hi): (vec_unpacku_lo, vec_widen_umult_hi, vec_widen_umult_lo): (vec_widen_smult_hi, vec_widen_smult_lo): New. * doc/c-tree.texi (VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR): (VEC_WIDEN_MULT_HI_EXPR, VEC_WIDEN_MULT_LO_EXPR, VEC_UNPACK_HI_EXPR): (VEC_UNPACK_LO_EXPR, VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New. * config/rs6000/altivec.md (UNSPEC_VMULWHUB, UNSPEC_VMULWLUB): (UNSPEC_VMULWHSB, UNSPEC_VMULWLSB, UNSPEC_VMULWHUH, UNSPEC_VMULWLUH): (UNSPEC_VMULWHSH, UNSPEC_VMULWLSH): New. (UNSPEC_VPERMSI, UNSPEC_VPERMHI): New. (vec_vperm_v8hiv4si, vec_vperm_v16qiv8hi): New patterns used to implement the unsigned unpacking patterns. (vec_unpacks_hi_v16qi, vec_unpacks_hi_v8hi, vec_unpacks_lo_v16qi): (vec_unpacks_lo_v8hi): New signed unpacking patterns. (vec_unpacku_hi_v16qi, vec_unpacku_hi_v8hi, vec_unpacku_lo_v16qi): (vec_unpacku_lo_v8hi): New unsigned unpacking patterns. (vec_widen_umult_hi_v16qi, vec_widen_umult_lo_v16qi): (vec_widen_smult_hi_v16qi, vec_widen_smult_lo_v16qi): (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): (vec_widen_smult_hi_v8hi, vec_widen_smult_lo_v8hi): New widening multiplication patterns. * target.h (builtin_mul_widen_even, builtin_mul_widen_odd): New. * target-def.h (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. * config/rs6000/rs6000.c (rs6000_builtin_mul_widen_even): New. (rs6000_builtin_mul_widen_odd): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): Defined. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): Defined. * tree-vectorizer.h (enum vect_relevant): New enum type. (_stmt_vec_info): Field relevant chaned from bool to enum vect_relevant. (STMT_VINFO_RELEVANT_P): Updated. (STMT_VINFO_RELEVANT): New. * tree-vectorizer.c (new_stmt_vec_info): Use STMT_VINFO_RELEVANT instead of STMT_VINFO_RELEVANT_P. * tree-vect-analyze.c (vect_mark_relevant, vect_stmt_relevant_p): Replace calls to STMT_VINFO_RELEVANT_P with STMT_VINFO_RELEVANT, and boolean variable with enum vect_relevant. (vect_mark_stmts_to_be_vectorized): Likewise + update documentation. * doc/tm.texi (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_EVEN): New. (TARGET_VECTORIZE_BUILTIN_MUL_WIDEN_ODD): New. 2006-11-08 Richard Henderson <rth@redhat.com> * config/i386/sse.md (vec_widen_umult_hi_v8hi, vec_widen_umult_lo_v8hi): New. (vec_widen_smult_hi_v4si, vec_widen_smult_lo_v4si, vec_widen_umult_hi_v4si, vec_widen_umult_lo_v4si): New. * config/i386/i386.c (ix86_expand_sse_unpack): New. * config/i386/i386-protos.h (ix86_expand_sse_unpack): New. * config/i386/sse.md (vec_unpacku_hi_v16qi, vec_unpacks_hi_v16qi, vec_unpacku_lo_v16qi, vec_unpacks_lo_v16qi, vec_unpacku_hi_v8hi, vec_unpacks_hi_v8hi, vec_unpacku_lo_v8hi, vec_unpacks_lo_v8hi, vec_unpacku_hi_v4si, vec_unpacks_hi_v4si, vec_unpacku_lo_v4si, vec_unpacks_lo_v4si): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_type_demotion): New function. (vect_transform_stmt): Add case for type_demotion_vec_info_type. (vect_analyze_operations): Call vectorizable_type_demotion. * tree-vectorizer.h (type_demotion_vec_info_type): New enum stmt_vec_info_type value. (vectorizable_type_demotion): New function declaration. * tree-vect-generic.c (expand_vector_operations_1): Consider correct mode. * tree.def (VEC_PACK_MOD_EXPR, VEC_PACK_SAT_EXPR): New tree-codes. * expr.c (expand_expr_real_1): Add case for VEC_PACK_MOD_EXPR and VEC_PACK_SAT_EXPR. * tree-iniline.c (estimate_num_insns_1): Likewise. * tree-pretty-print.c (dump_generic_node, op_prio): Likewise. * optabs.c (optab_for_tree_code): Likewise. * optabs.c (expand_binop): In case of vec_pack_*_optabs the mode compared against the predicate of the result is not 'mode' (the input to the function) but a mode with half the size of 'mode'. (init_optab): Initialize new optabs. * optabs.h (OTI_vec_pack_mod, OTI_vec_pack_ssat, OTI_vec_pack_usat): New optab indices. (vec_pack_mod_optab, vec_pack_ssat_optab, vec_pack_usat_optab): New optabs. * genopinit.c (vec_pack_mod_optab, vec_pack_ssat_optab): (vec_pack_usat_optab): Initialize new optabs. * doc/md.texi (vec_pack_mod, vec_pack_ssat, vec_pack_usat): New. * config/rs6000/altivec.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): New. 2006-11-08 Richard Henderson <rth@redehat.com> * config/i386/sse.md (vec_pack_mod_v8hi, vec_pack_mod_v4si): (vec_pack_mod_v2di, vec_interleave_highv16qi, vec_interleave_lowv16qi): (vec_interleave_highv8hi, vec_interleave_lowv8hi): (vec_interleave_highv4si, vec_interleave_lowv4si): (vec_interleave_highv2di, vec_interleave_lowv2di): New. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_reduction): Support multiple datatypes. (vect_transform_stmt): Removed redundant code. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vectorizable_operation): Support multiple datatypes. 2006-11-08 Dorit Nuzman <dorit@il.ibm.com> * tree-vect-transform.c (vect_align_data_ref): Removed. (vect_create_data_ref_ptr): Added additional argument - ptr_incr. Updated function documentation. Return the increment stmt in ptr_incr. (bump_vector_ptr): New function. (vect_get_vec_def_for_stmt_copy): New function. (vect_finish_stmt_generation): Create a stmt_info to newly created vector stmts. (vect_setup_realignment): Call vect_create_data_ref_ptr with additional argument. (vectorizable_reduction, vectorizable_assignment): Not supported yet if VF is greater than the number of elements that can fit in one vector word. (vectorizable_operation, vectorizable_condition): Likewise. (vectorizable_store, vectorizable_load): Support the case that the VF is greater than the number of elements that can fit in one vector word. (vect_transform_loop): Don't fail in case of multiple data-types. * tree-vect-analyze.c (vect_determine_vectorization_factor): Don't fail in case of multiple data-types; the smallest type determines the VF. (vect_analyze_data_ref_dependence): Don't record datarefs as same_align if they are of different sizes. (vect_update_misalignment_for_peel): Compare misalignments in terms of number of elements rather than number of bytes. (vect_enhance_data_refs_alignment): Fix/Add dump printouts. (vect_can_advance_ivs_p): Fix a dump printout From-SVN: r118577
2006-11-08 08:32:44 +01:00
case VEC_PACK_SAT_EXPR:
return TYPE_UNSIGNED (type) ? vec_pack_usat_optab : vec_pack_ssat_optab;
re PR tree-optimization/24659 (Conversions are not vectorized) 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * optabs.h (enum optab_index) [OTI_vec_unpacks_hi, OTI_vec_unpacks_lo]: Update comment to mention floating point operands. (vec_pack_trunc_optab): Rename from vec_pack_mod_optab. * genopinit.c (optabs): Rename vec_pack_mod_optab to vec_pack_trunc_optab. * tree-vect-transform.c (vectorizable_type_demotion): Do not fail early for scalar floating point operands for NOP_EXPR. (vectorizable_type_promotion): Ditto. * optabs.c (optab_for_tree_code) [VEC_PACK_TRUNC_EXPR]: Return vec_pack_trunc_optab. (expand_binop): Rename vec_float_trunc_optab to vec_pack_mod_optab. * tree.def (VEC_PACK_TRUNC_EXPR): Rename from VEC_PACK_MOD_EXPR. * tree-pretty-print.c (dump_generic_node) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. (op_prio) [VEC_PACK_TRUNC_EXPR]: Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_hi_v4sf): New expander. (vec_unpacks_lo_v4sf): Ditto. (vec_pack_trunc_v2df): Ditto. (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. (vec_pack_trunc_v2di): Rename from vec_pack_mod_v2di. * config/rs6000/altivec.md (vec_pack_trunc_v8hi): Rename from vec_pack_mod_v8hi. (vec_pack_trunc_v4si): Rename from vec_pack_mod_v4si. * doc/c-tree.texi (Expression trees) [VEC_PACK_TRUNC_EXPR]: Rename from VEC_PACK_MOD_EXPR. This expression also represent packing of floating point operands. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO_EXPR]: These expression also represent unpacking of floating point operands. * doc/md.texi (Standard Names) [vec_pack_trunc]: Update documentation. [vec_unpacks_hi]: Ditto. [vec_unpacks_lo]: Ditto. testsuite/ChangeLog: 2007-04-22 Uros Bizjak <ubizjak@gmail.com> PR tree-optimization/24659 * gcc.dg/vect/vect-float-extend-1.c: New test. * gcc.dg/vect/vect-float-truncate-1.c: New test. From-SVN: r124045
2007-04-22 20:45:06 +02:00
re PR tree-optimization/24659 (Conversions are not vectorized) PR tree-optimization/24659 * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi, OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi, OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and OTI_vec_pack_ufix_trunc. (vec_unpacks_float_hi_optab): Define new macro. (vec_unpacks_float_lo_optab): Ditto. (vec_unpacku_float_hi_optab): Ditto. (vec_unpacku_float_lo_optab): Ditto. (vec_pack_sfix_trunc_optab): Ditto. (vec_pack_ufix_trunc_optab): Ditto. * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[s|u]fix_trunc_optab using vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns * tree-vectorizer.c (supportable_widening_operation): Handle FLOAT_EXPR and CONVERT_EXPR. Update comment. (supportable_narrowing_operation): New function. * tree-vectorizer.h (supportable_narrowing_operation): Prototype. * tree-vect-transform.c (vectorizable_conversion): Handle (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases. (vect_gen_widened_results_half): Move before vectorizable_conversion. (vectorizable_type_demotion): Call supportable_narrowing_operation() to check for target support. * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab for VEC_PACK_FIX_TRUNC_EXPR. (expand_binop): Special case mode of the result for vec_pack_[u|s]fix_trunc_optab. (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[u|s]fix_trunc_optab. * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR, VEC_PACK_FIX_TRUNC_EXPR): New tree codes. * tree-pretty-print.c (dump_generic_node): Handle VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and VEC_PACK_FIX_TRUNC_EXPR. (op_prio): Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander. (vec_unpacks_float_lo_v8hi): Ditto. (vec_unpacku_float_hi_v8hi): Ditto. (vec_unpacku_float_lo_v8hi): Ditto. (vec_unpacks_float_hi_v4si): Ditto. (vec_unpacks_float_lo_v4si): Ditto. (vec_pack_sfix_trunc_v2df): Ditto. * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]: Document. [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto. [VEC_PACK_FIX_TRUNC_EXPR]: Ditto. * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document. [vec_pack_ufix_trunc]: Ditto. [vec_unpacks_float_hi]: Ditto. [vec_unpacks_float_lo]: Ditto. [vec_unpacku_float_hi]: Ditto. [vec_unpacku_float_lo]: Ditto. testsuite/ChangeLog: PR tree-optimization/24659 * gcc.dg/vect/vect-floatint-conversion-2.c: New test. * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float, not vect_int target. * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float, not vect_int target. Loop is vectorized for vect_intfloat_cvt targets. * gcc.dg/vect/vect-intfloat-conversion-3.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test. From-SVN: r124784
2007-05-17 08:31:05 +02:00
case VEC_PACK_FIX_TRUNC_EXPR:
/* The signedness is determined from output operand. */
re PR tree-optimization/24659 (Conversions are not vectorized) PR tree-optimization/24659 * optabs.h (enum optab_index): Add OTI_vec_unpacks_float_hi, OTI_vec_unpacks_float_lo, OTI_vec_unpacku_float_hi, OTI_vec_unpacku_float_lo, OTI_vec_pack_sfix_trunc and OTI_vec_pack_ufix_trunc. (vec_unpacks_float_hi_optab): Define new macro. (vec_unpacks_float_lo_optab): Ditto. (vec_unpacku_float_hi_optab): Ditto. (vec_unpacku_float_lo_optab): Ditto. (vec_pack_sfix_trunc_optab): Ditto. (vec_pack_ufix_trunc_optab): Ditto. * genopinit.c (optabs): Implement vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[s|u]fix_trunc_optab using vec_unpack[s|u]_[hi\lo]_* and vec_pack_[u|s]fix_trunc_* patterns * tree-vectorizer.c (supportable_widening_operation): Handle FLOAT_EXPR and CONVERT_EXPR. Update comment. (supportable_narrowing_operation): New function. * tree-vectorizer.h (supportable_narrowing_operation): Prototype. * tree-vect-transform.c (vectorizable_conversion): Handle (nunits_in == nunits_out / 2) and (nunits_out == nunits_in / 2) cases. (vect_gen_widened_results_half): Move before vectorizable_conversion. (vectorizable_type_demotion): Call supportable_narrowing_operation() to check for target support. * optabs.c (optab_for_tree_code) Return vec_unpack[s|u]_float_hi_optab for VEC_UNPACK_FLOAT_HI_EXPR, vec_unpack[s|u]_float_lo_optab for VEC_UNPACK_FLOAT_LO_EXPR and vec_pack_[u|s]fix_trunc_optab for VEC_PACK_FIX_TRUNC_EXPR. (expand_binop): Special case mode of the result for vec_pack_[u|s]fix_trunc_optab. (init_optabs): Initialize vec_unpack[s|u]_[hi|lo]_optab and vec_pack_[u|s]fix_trunc_optab. * tree.def (VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR, VEC_PACK_FIX_TRUNC_EXPR): New tree codes. * tree-pretty-print.c (dump_generic_node): Handle VEC_UNPACK_FLOAT_HI_EXPR, VEC_UNPACK_FLOAT_LO_EXPR and VEC_PACK_FIX_TRUNC_EXPR. (op_prio): Ditto. * expr.c (expand_expr_real_1): Ditto. * tree-inline.c (estimate_num_insns_1): Ditto. * tree-vect-generic.c (expand_vector_operations_1): Ditto. * config/i386/sse.md (vec_unpacks_float_hi_v8hi): New expander. (vec_unpacks_float_lo_v8hi): Ditto. (vec_unpacku_float_hi_v8hi): Ditto. (vec_unpacku_float_lo_v8hi): Ditto. (vec_unpacks_float_hi_v4si): Ditto. (vec_unpacks_float_lo_v4si): Ditto. (vec_pack_sfix_trunc_v2df): Ditto. * doc/c-tree.texi (Expression trees) [VEC_UNPACK_FLOAT_HI_EXPR]: Document. [VEC_UNPACK_FLOAT_LO_EXPR]: Ditto. [VEC_PACK_FIX_TRUNC_EXPR]: Ditto. * doc/md.texi (Standard Names) [vec_pack_sfix_trunc]: Document. [vec_pack_ufix_trunc]: Ditto. [vec_unpacks_float_hi]: Ditto. [vec_unpacks_float_lo]: Ditto. [vec_unpacku_float_hi]: Ditto. [vec_unpacku_float_lo]: Ditto. testsuite/ChangeLog: PR tree-optimization/24659 * gcc.dg/vect/vect-floatint-conversion-2.c: New test. * gcc.dg/vect/vect-intfloat-conversion-1.c: Require vect_float, not vect_int target. * gcc.dg/vect/vect-intfloat-conversion-2.c: Require vect_float, not vect_int target. Loop is vectorized for vect_intfloat_cvt targets. * gcc.dg/vect/vect-intfloat-conversion-3.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4a.c: New test. * gcc.dg/vect/vect-intfloat-conversion-4b.c: New test. From-SVN: r124784
2007-05-17 08:31:05 +02:00
return TYPE_UNSIGNED (type) ?
vec_pack_ufix_trunc_optab : vec_pack_sfix_trunc_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
default:
break;
}
common.opt: Add fstrict-overflow. ./: * common.opt: Add fstrict-overflow. * opts.c (decode_options): Set flag_strict_overflow if -O2. * flags.h (TYPE_OVERFLOW_WRAPS): Define. (TYPE_OVERFLOW_UNDEFINED): Define. (TYPE_OVERFLOW_TRAPS): Define. This replaces TYPE_TRAP_SIGNED. Replace all uses. * tree.h (TYPE_TRAP_SIGNED): Don't define. * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_UNDEFINED. (fold_negate_expr): Likewise. (make_range): Likewise. (extract_muldiv_1): Likewise. (maybe_canonicalize_comparison): Likewise. (fold_comparison): Likewise. (fold_binary): Likewise. (tree_expr_nonnegative_p): Likewise. (tree_expr_nonzero_p): Likewise. * tree-vrp.c (compare_values): Likewise. (extract_range_from_binary_expr): Likewise. (extract_range_from_unary_expr): Likewise. * tree-ssa-loop-niter.c (infer_loop_bounds_from_signedness): Likewise. (nowrap_type_p): Likewise. * tree-scalar-evolution.c (simple_iv): Likewise. * fold-const.c (negate_expr_p): Use TYPE_OVERFLOW_WRAPS. (build_range_check): Likewise. (extract_muldiv_1): Likewise. (fold_comparison): Likewise. * tree-vrp.c (vrp_int_const_binop): Likewise. (extract_range_from_unary_expr): Likewise. * convert.c (convert_to_integer): Likewise. * fold-const.c (fold_negate_expr): Use TYPE_OVERFLOW_TRAPS. (fold_comparison): Likewise. (fold_binary): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-vectorizer.c (vect_is_simple_reduction): Likewise. * simplify-rtx.c (simplify_const_relational_operation): Check flag_strict_overflow and flag_trapv. (simplify_const_relational_operation): Likewise. * doc/invoke.texi (Option Summary): Mention -fstrict-overflow. (Optimize Options): Add -fstrict-overflow to -O2 list. Document -fstrict-overflow. testsuite/: * gcc.dg/strict-overflow-1.c: New test. * gcc.dg/no-strict-overflow-1.c: New test. * gcc.dg/strict-overflow-2.c: New test. * gcc.dg/no-strict-overflow-2.c: New test. * gcc.dg/strict-overflow-3.c: New test. * gcc.dg/no-strict-overflow-3.c: New test. * gcc.dg/strict-overflow-4.c: New test. * gcc.dg/no-strict-overflow-4.c: New test. * gcc.dg/fold-mod-1.c: Add -fstrict-overflow option. * gcc.dg/pr15784-1.c: Likewise. * gcc.dg/pr20922-1.c: Likewise. * gcc.dg/pr20922-3.c: Likewise. * gcc.dg/pr20922-4.c: Likewise. * gcc.dg/pr20922-6.c: Likewise. * gcc.dg/compare-4.c: Likewise. * gcc.dg/torture/pr26898-1.c: Likewise. * gcc.dg/tree-ssa/divide-1.c: Likewise. * gcc.dg/tree-ssa/divide-2.c: Likewise. * gcc.dg/tree-ssa/divide-3.c: Likewise. * gcc.dg/tree-ssa/divide-4.c: Likewise. * gcc.dg/tree-ssa/pr14490-1.c: Likewise. * gcc.dg/tree-ssa/pr14490-3.c: Likewise. * gcc.dg/tree-ssa/pr21082.c: Likewise. * gcc.dg/tree-ssa/pr26899.c: Likewise. * g++.dg/tree-ssa/pr21082.C: Likewise. From-SVN: r121254
2007-01-28 06:15:06 +01:00
trapv = INTEGRAL_TYPE_P (type) && TYPE_OVERFLOW_TRAPS (type);
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
switch (code)
{
[multiple changes] 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> Zdenek Dvorak <dvorakz@suse.cz> Richard Guenther <rguenther@suse.de> Kaz Kojima <kkojima@gcc.gnu.org> * tree-vrp.c (compare_values_warnv): Convert val2 to the type of val1. (extract_range_from_assert): Create POINTER_PLUS_EXPR for pointer types. (extract_range_from_binary_expr): Handle only POINTER_PLUS_EXPR, MIN_EXPR, and MAX_EXPR for pointer types. * doc/c-tree.texi (POINTER_PLUS_EXPR): Document. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (number_of_iterations_lt_to_ne): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (assert_loop_rolls_lt): For pointer types, use sizetype when creating MINUS_EXPR/PLUS_EXPRs. (number_of_iterations_le): Likewise. (expand_simple_operations): POINTER_PLUS_EXPR are simple also. (derive_constant_upper_bound): Handle POINTER_PLUS_EXPR just like PLUS_EXPR and MINUS_EXPR. * tree-pretty-print.c (dump_generic_node): Handle POINTER_PLUS_EXPR. (op_prio): Likewise. (op_symbol_1): Likewise. * optabs.c (optab_for_tree_code): Likewise. * tree-ssa-loop-manip.c (create_iv): Handle pointer base specially. * tree-tailcall.c (process_assignment): Mention POINTER_PLUS_EXPR in a TODO comment. * tree.c (build2_stat): Assert when trying to use PLUS_EXPR or MINUS_EXPR with a pointer. Also assert for POINTER_PLUS_EXPR not used with a pointer and an integer type. * tree-scalar-evolution.c (add_to_evolution_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. (follow_ssa_edge_in_rhs): Handle POINTER_PLUS_EXPR like PLUS_EXPR except for the right hand side's type will be sizetype. (interpret_rhs_modify_stmt): Handle POINTER_PLUS_EXPR. (fold_used_pointer_cast): Kill. (pointer_offset_p): Kill. (fold_used_pointer): Kill. (pointer_used_p): Kill. (analyze_scalar_evolution_1 <case GIMPLE_MODIFY_STMT>): Don't call fold_used_pointer. (instantiate_parameters_1): Convert the increment using chrec_convert_rhs instead of chrec_convert. Handle POINTER_PLUS_EXPR as PLUS_EXPR. * builtins.c (get_pointer_alignment): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (expand_builtin_strcat): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (std_gimplify_va_arg_expr): Likewise. (fold_builtin_memory_op): Likewise. (fold_builtin_strstr): Likewise. (fold_builtin_strchr): Likewise. (fold_builtin_strrchr): Likewise. (fold_builtin_strpbrk): Likewise. (expand_builtin_memory_chk): Likewise. (fold_builtin_memory_chk): Likewise. (std_expand_builtin_va_start): Use sizetype for the call to make_tree and then convert to the pointer type. (fold_builtin_memchr): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for adding to a pointer. (std_gimplify_va_arg_expr): Use fold_build2 for the creating of POINTER_PLUS_EXPR. For the BIT_AND_EXPR, cast the operands to sizetype first and then cast the BIT_AND_EXPR back to the pointer type. * fold-const.c (build_range_check): Handle pointer types specially. (extract_array_ref): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Make sure the offset is converted to sizetype. (try_move_mult_to_index): Strip the NOPs from the offset. Remove code argument and replace all uses with PLUS_EXPR. (fold_to_nonsharp_ineq_using_bound): Handle pointer types specially. Don't use a pointer type for MINUS_EXPR. (fold_unary): Handle for (T1)(X op Y), only p+ as that is the only as that can be handled for binary operators now. (fold_binary <case POINTER_PLUS_EXPR>): Add folding of POINTER_PLUS_EXPR. <case PLUS_EXPR>: Add folding of PTR+INT into PTR p+ INT. Don't call try_move_mult_to_index. <case MINUS_EXPR>: Fold (PTR0 p+ A) - (PTR1 p+ B) into (PTR0 - PTR1) + (A - B). Fold (PTR0 p+ A) - PTR1 into (PTR0 - PTR1) + A iff (PTR0 - PTR1) simplifies. Don't call try_move_mult_to_index. (tree_expr_nonnegative_warnv_p): Handle POINTER_PLUS_EXPR. (tree_expr_nonzero_p): Likewise. (fold_indirect_ref_1): Look at POINTER_PLUS_EXPR instead of PLUS_EXPR for the complex expression folding. * tree-chrec.c (chrec_fold_plus_poly_poly): If the first chrec is a pointer type, then the second should be sizetype and not the first's type. For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus_1): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_fold_plus): For pointer types, use POINTER_PLUS_EXPR instead of PLUS_EXPR. When either operand is zero, convert the other operand. (chrec_apply): Use chrec_convert_rhs on the argument x instead of chrec_convert. (reset_evolution_in_loop): For pointer types, the new_evol should be sizetype. (convert_affine_scev): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. (chrec_convert_rhs): New function. (chrec_convert_aggressive): For POINTER_PLUS_EXPR, use a different right hand side type. Handle POINTER_PLUS_EXPR like PLUS_EXPR. * tree-chrec.h (chrec_convert_rhs): New prototype. (build_polynomial_chrec): For pointer types, the right hand * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Look for POINTER_PLUS_EXPR instead of PLUS_EXPR's. Remove subtraction case as it is always addition now. Make sure the offset is converted to sizetype. (fold_stmt_r): Don't handle PLUS_EXPR/MINUS_EXPR specially. Handle POINTER_PLUS_EXPR like PLUS_EXPR was handled before. * tree-ssa-loop-ivopts.c (determine_base_object): Abort for PLUS_EXPR in pointer type. Handle POINTER_PLUS_EXPR. (tree_to_aff_combination): Likewise. (force_expr_to_var_cost): Likewise. (force_expr_to_var_cost): Likewise. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * c-format.c (check_format_arg): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR of pointer types. * tree-stdarg.c (va_list_counter_bump): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (check_va_list_escapes): Likewise. (check_all_va_list_escapes): Likewise. * dwarf2out.c (loc_descriptor_from_tree_1): Handle POINT_PLUS_EXPR as a PLUS_EXPR. * expr.c (expand_expr_real_1): Handle POINTER_PLUS_EXPR. (string_constant): Likewise. * tree-ssa-address.c (tree_mem_ref_addr): When adding the offset to the base, use POINTER_PLUS_EXPR. (add_to_parts): Convert the index to sizetype. (create_mem_ref): Create A POINTER_PLUS_EXPR for the one case. * matrix-reorg.c (collect_data_for_malloc_call): Stmt will now only be either INDIRECT_REF and POINTER_PLUS_EXPR. Offset only holds something for PLUS_EXPR. (ssa_accessed_in_tree): Handle POINTER_PLUS_EXPR just as a PLUS_EXPR. (analyze_transpose): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. (analyze_accesses_for_modify_stmt): Likewise. Remove comment about the type being integral type as it is wrong now. (can_calculate_expr_before_stmt): Handle POINTER_PLUS_EXPR as PLUS_EXPR. (transform_access_sites): POINTER_PLUS_EXPR will only show up now and not PLUS_EXPR. Correct the type which the artimentic is done in (is now sizetype). Reindent one loop. * tree-data-ref.c (split_constant_offset): Handle POINTER_PLUS_EXPR * tree-affine.c (tree_to_aff_combination): Likewise. * c-typeck.c (build_unary_op): For pointers create the increment as a sizetype. Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * gimplify.c (gimplify_self_mod_expr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (gimplify_omp_atomic_fetch_op): Handle POINTER_PLUS_EXPR. * tree.def (POINTER_PLUS_EXPR): New tree code. * tree-predcom.c (ref_at_iteration): If we have a pointer type do the multiplication in sizetype. * tree-mudflap.c (mf_xform_derefs_1): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Don't expect there to be a cast for the index as that does not exist anymore. (forward_propagate_addr_expr_1): Check for POINTER_PLUS_EXPR instead of PLUS_EXPR. Don't check for the first operand of the POINTER_PLUS_EXPR was the index as it cannot be. Call forward_propagate_addr_into_variable_array_index with the SSA_NAME instead of the statement. * varasm.c (const_hash_1): Handle POINTER_PLUS_EXPR. (compare_constant): Likewise. (copy_constant): Likewise. (compute_reloc_for_constant): Likewise. (output_addressed_constants): Likewise. (initializer_constant_valid_p): Likewise. * tree-ssa.c (tree_ssa_useless_type_conversion_1): Convert the MIN/MAX of the inner type to the outer type before comparing them. * tree-ssa-loop-prefetch.c (idx_analyze_ref): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (issue_prefetch_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-inline.c (estimate_num_insns_1): Handle POINTER_PLUS_EXPR. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (bump_vector_ptr): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for the pointer increment statement. (vect_update_ivs_after_vectorizer): For pointer types, create POINTER_PLUS_EXPR instead of PLUS_EXPR and also create MULT_EXPR in sizetype. (vect_gen_niters_for_prolog_loop): Add a cast when creating byte_misalign. * tree-object-size.c (plus_expr_object_size): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. (check_for_plus_in_loops_1): Likewise. (check_for_plus_in_loops): Likewise. * c-common.c (pointer_int_sum): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * tree-ssa-structalias.c (handle_ptr_arith): Handle only POINTER_PLUS_EXPR. Removing all the extra code which is trying to figure out which side is a pointer and is the index. * tree-cfg.c (verify_expr): Add extra checking for pointers and PLUS_EXPR and MINUS_EXPR. Also add checking to make sure the operands of POINTER_PLUS_EXPR are correct. * config/frv/frv.c (frv_expand_builtin_va_start): Use sizetype with make_tree, instead of a pointer type. * config/s390/s390.c (s390_va_start): Use POINTER_PLUS_EXPR for pointers instead of PLUS_EXPR. (s390_gimplify_va_arg): Likewise. * config/spu/spu.c (spu_va_start): Create POINTER_PLUS_EXPR instead of PLUS_EXPR when doing addition on pointer types. Use sizetype for the second operand. (spu_gimplify_va_arg_expr): Likewise. * config/sparc/sparc.c (sparc_gimplify_va_arg): Use POINTER_PLUS_EXPR instead of PLUS_EXPR when the operand was a pointer. Don't create a BIT_AND_EXPR for pointer types. * config/i386/i386.c (ix86_va_start): Use POINTER_PLUS_EXPR for the pointer addition and also use size_int/sizetype for the offset. (ix86_gimplify_va_arg): Likewise. Perform BIT_AND_EXPR on sizetype arguments. * config/sh/sh.c (sh_va_start): Call make_tree with sizetype and convert its result to a pointer type. Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. (sh_gimplify_va_arg_expr): Use POINTER_PLUS_EXPR for the pointer additions and also use size_int for the offsets. Perform BIT_AND_EXPR on sizetype arguments. * config/ia64/ia64.c (ia64_gimplify_va_arg): Use POINTER_PLUS_EXPR for pointers and create the BIT_AND_EXPR in sizetype. * config/rs6000/rs6000.c (rs6000_va_start): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. (rs6000_va_start): Likewise. Also use sizetype for the offset. * config/pa/pa.c (reloc_needed): Handle POINTER_PLUS_EXPR as PLUS_EXPR/MINUS_EXPR. (hppa_gimplify_va_arg_expr): Don't create MINUS_EXPR or PLUS_EXPR for pointers, instead use POINTER_PLUS_EXPR. Don't use BIT_AND_EXPR on a pointer type, convert the expression to sizetype first. * config/mips/mips.c (mips_va_start): Use POINTER_PLUS_EXPR for pointers. (mips_gimplify_va_arg_expr): Likewise. Don't create BIT_AND_EXPR in a pointer type. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans-intrinsic.c (gfc_conv_intrinsic_repeat): Use POINTER_PLUS_EXPR instead of PLUS_EXPR for pointer addition. * trans-expr.c (gfc_trans_string_copy): Create POINTER_PLUS_EXPR instead of a PLUS_EXPR for pointer types. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * typeck.c (build_binary_op): For templates build the expression in pieces to avoid the assert in build2_stat. (get_member_function_from_ptrfunc): Change over to using POINTER_PLUS_EXPR and convert the second operand to sizetype. * typeck2.c (build_m_component_ref): Likewise. * init.c (expand_virtual_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. (build_new_1): Likewise. (build_vec_delete_1): Likewise. (build_vec_delete): Likewise. * class.c (build_base_path): Likewise. (build_base_path): Likewise. (convert_to_base_statically): Likewise. (fixed_type_or_null): Handle POINTER_PLUS_EXPR. (get_vtbl_decl_for_binfo): Handle POINTER_PLUS_EXPR instead of PLUS_EXPR. (dfs_accumulate_vtbl_inits): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * call.c (build_special_member_call): Likewise. * rtti.c (build_headof): Likewise. Use sizetype instead of ptrdiff_type_node. (tinfo_base_init): Create a POINTER_PLUS_EXPR instead of PLUS_EXPR for pointers. * except.c (expand_start_catch_block): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. * cp-gimplify.c (cxx_omp_clause_apply_fn): Convert PLUS_EXPR on pointer types over to use POINTER_PLUS_EXPR and remove the conversion to the pointer types. * method.c (thunk_adjust): Use POINTER_PLUS_EXPR for adding to a pointer type. Use size_int instead of ssize_int. Convert the index to sizetype before adding it to the pointer. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * trans.c (Attribute_to_gnu): When subtracting an offset from a pointer, use POINTER_PLUS_EXPR with NEGATE_EXPR instead of MINUS_EXPR. (gnat_to_gnu): Likewise. * utils.c (convert): When converting between thin pointers, use POINTER_PLUS_EXPR and sizetype for the offset. * utils2.c (known_alignment): POINTER_PLUS_EXPR have the same semantics as PLUS_EXPR for alignment. (build_binary_op): Add support for the semantics of POINTER_PLUS_EXPR's operands. When adding an offset to a pointer, use POINTER_PLUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> * class.c (make_class_data): Build the index in sizetype. Use POINTER_PLUS_EXPR instead of PLUS_EXPR when adding to a pointer type. (build_symbol_entry): Likewise. * expr.c (build_java_arrayaccess): Likewise. (build_field_ref): Likewise. (build_known_method_ref): Likewise. (build_invokevirtual): Likewise. * except.c (build_exception_object_ref): Do a NEGATIVE and then a POINTER_PLUS_EXPR instead of a MINUS_EXPR. 2007-06-15 Andrew Pinski <andrew_pinski@playstation.sony.com> PR tree-opt/32225 * gcc.c-torture/compile/20070605-1.c: New test. * gcc.c-torture/compile/20070603-1.c: New testcase. * gcc.c-torture/compile/20070603-2.c: New testcase. * gcc.c-torture/compile/20070531-1.c: New test. PR tree-opt/32167 * gcc.c-torture/compile/20070531-2.c: New test. PR tree-opt/32144 * gcc.c-torture/compile/20070529-1.c: New test. PR tree-opt/32145 * gcc.c-torture/compile/20070529-2.c: New test. PR tree-opt/32015 * gcc.c-torture/compile/20070520-1.c: New test. * g++.dg/ext/java-1.C: New test. * gcc.dg/vect/vect-106.c: We are now able to vectorize two loops instead of one. Remove the "can't determine dependence" check. * gcc.dg/tree-ssa/20030815-1.c: Remove testcase which is no longer needed as the cast is gone in the first place. * gcc.dg/max-1.c: Change local variable a to be a global one. * gcc.dg/tree-ssa/ssa-pre-8.c: Update testcase since we don't have a cast which is PREd. From-SVN: r125755
2007-06-16 07:42:36 +02:00
case POINTER_PLUS_EXPR:
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
case PLUS_EXPR:
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usadd_optab : ssadd_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return trapv ? addv_optab : add_optab;
case MINUS_EXPR:
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? ussub_optab : sssub_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return trapv ? subv_optab : sub_optab;
case MULT_EXPR:
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usmul_optab : ssmul_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return trapv ? smulv_optab : smul_optab;
case NEGATE_EXPR:
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (TYPE_SATURATING (type))
return TYPE_UNSIGNED (type) ? usneg_optab : ssneg_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
return trapv ? negv_optab : neg_optab;
case ABS_EXPR:
return trapv ? absv_optab : abs_optab;
default:
return unknown_optab;
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
}
}
/* Given optab UNOPTAB that reduces a vector to a scalar, find instead the old
optab that produces a vector with the reduction result in one element,
for a tree with type TYPE. */
optab
scalar_reduc_to_vector (optab unoptab, const_tree type)
{
switch (unoptab)
{
case reduc_plus_scal_optab:
return TYPE_UNSIGNED (type) ? reduc_uplus_optab : reduc_splus_optab;
case reduc_smin_scal_optab: return reduc_smin_optab;
case reduc_umin_scal_optab: return reduc_umin_optab;
case reduc_smax_scal_optab: return reduc_smax_optab;
case reduc_umax_scal_optab: return reduc_umax_optab;
default: return unknown_optab;
}
}
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
/* Expand vector widening operations.
There are two different classes of operations handled here:
1) Operations whose result is wider than all the arguments to the operation.
Examples: VEC_UNPACK_HI/LO_EXPR, VEC_WIDEN_MULT_HI/LO_EXPR
In this case OP0 and optionally OP1 would be initialized,
but WIDE_OP wouldn't (not relevant for this case).
2) Operations whose result is of the same size as the last argument to the
operation, but wider than all the other arguments to the operation.
Examples: WIDEN_SUM_EXPR, VEC_DOT_PROD_EXPR.
In the case WIDE_OP, OP0 and optionally OP1 would be initialized.
E.g, when called to expand the following operations, this is how
the arguments will be initialized:
nops OP0 OP1 WIDE_OP
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
widening-sum 2 oprnd0 - oprnd1
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
widening-dot-product 3 oprnd0 oprnd1 oprnd2
widening-mult 2 oprnd0 oprnd1 -
type-promotion (vec-unpack) 1 oprnd0 - - */
rtx
expand_widen_pattern_expr (sepops ops, rtx op0, rtx op1, rtx wide_op,
rtx target, int unsignedp)
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand eops[4];
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
tree oprnd0, oprnd1, oprnd2;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wmode = VOIDmode, tmode0, tmode1 = VOIDmode;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
optab widen_pattern_optab;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
enum insn_code icode;
int nops = TREE_CODE_LENGTH (ops->code);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
int op;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
oprnd0 = ops->op0;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
tmode0 = TYPE_MODE (TREE_TYPE (oprnd0));
widen_pattern_optab =
optab_for_tree_code (ops->code, TREE_TYPE (oprnd0), optab_default);
With large parts from Jim Wilson: PR target/43902 * tree-pretty-print.c (dump_generic_node, op_code_prio): Add WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * optabs.c (optab_for_tree_code): Likewise. (expand_widen_pattern_expr): Likewise. * tree-ssa-math-opts.c (convert_mult_to_widen): New function, broken out of execute_optimize_widening_mul. (convert_plusminus_to_widen): New function. (execute_optimize_widening_mul): Use the two new functions. * expr.c (expand_expr_real_2): Add support for GIMPLE_TERNARY_RHS. Remove code to generate widening multiply-accumulate. Add support for WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): New function. (dump_gimple_assign): Call it when appropriate. * tree.def (WIDEN_MULT_PLUS_EXPR, WIDEN_MULT_MINUS_EXPR): New codes. * cfgexpand.c (gimple_assign_rhs_to_tree): Likewise. (expand_gimple_stmt_1): Likewise. (expand_debug_expr): Support WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * gimple.c (extract_ops_from_tree_1): Renamed from extract_ops_from_tree. Add new arg for a third operand; fill it. (gimple_build_assign_stat): Support operations with three operands. (gimple_build_assign_with_ops_stat): Likewise. (gimple_assign_set_rhs_from_tree): Likewise. (gimple_assign_set_rhs_with_ops_1): Renamed from gimple_assign_set_rhs_with_ops. Add new arg for a third operand. (get_gimple_rhs_num_ops): Support GIMPLE_TERNARY_RHS. (get_gimple_rhs_num_ops): Handle WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple.h (enum gimple_rhs_class): Add GIMPLE_TERNARY_RHS. (extract_ops_from_tree_1): Adjust declaration. (gimple_assign_set_rhs_with_ops_1): Likewise. (gimple_build_assign_with_ops): Pass NULL for last operand. (gimple_build_assign_with_ops3): New macro. (gimple_assign_rhs3, gimple_assign_rhs3_ptr, gimple_assign_set_rhs3, gimple_assign_set_rhs_with_ops, extract_ops_from_tree): New inline functions. * tree-cfg.c (verify_gimple_assign_ternary): New static function. (verify_gimple_assign): Call it. * doc/gimple.texi (Manipulating operands): Document GIMPLE_TERNARY_RHS. (Tuple specific accessors, subsection GIMPLE_ASSIGN): Document new functions for dealing with three-operand statements. * tree.c (commutative_ternary_tree_code): New function. * tree.h (commutative_ternary_tree_code): Declare it. * tree-vrp.c (gimple_assign_nonnegative_warnv_p): Return false for ternary statements. (gimple_assign_nonzero_warnv_p): Likewise. * tree-ssa-sccvn.c (stmt_has_constants): Handle GIMPLE_TERNARY_RHS. * tree-ssa-ccp.c (get_rhs_assign_op_for_ccp): New static function. (ccp_fold): Use it. Handle GIMPLE_TERNARY_RHS. * tree-ssa-dom.c (enum expr_kind): Add EXPR_TERNARY. (struct hashtable_expr): New member ternary in the union. (initialize_hash_element): Handle GIMPLE_TERNARY_RHS. (hashable_expr_equal_p): Fix indentation. Handle EXPR_TERNARY. (iterative_hash_hashable_expr): Likewise. (print_expr_hash_elt): Handle EXPR_TERNARY. * gimple-fold.c (fold_gimple_assign): Handle GIMPLE_TERNARY_RHS. * tree-ssa-threadedge.c (fold_assignment_stmt): Remove useless break statements. Handle GIMPLE_TERNARY_RHS. testsuite/ PR target/43902 * gcc.target/mips/madd-9.c: New test. From-SVN: r161366
2010-06-25 10:56:24 +02:00
if (ops->code == WIDEN_MULT_PLUS_EXPR
|| ops->code == WIDEN_MULT_MINUS_EXPR)
icode = find_widening_optab_handler (widen_pattern_optab,
TYPE_MODE (TREE_TYPE (ops->op2)),
tmode0, 0);
With large parts from Jim Wilson: PR target/43902 * tree-pretty-print.c (dump_generic_node, op_code_prio): Add WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * optabs.c (optab_for_tree_code): Likewise. (expand_widen_pattern_expr): Likewise. * tree-ssa-math-opts.c (convert_mult_to_widen): New function, broken out of execute_optimize_widening_mul. (convert_plusminus_to_widen): New function. (execute_optimize_widening_mul): Use the two new functions. * expr.c (expand_expr_real_2): Add support for GIMPLE_TERNARY_RHS. Remove code to generate widening multiply-accumulate. Add support for WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple-pretty-print.c (dump_ternary_rhs): New function. (dump_gimple_assign): Call it when appropriate. * tree.def (WIDEN_MULT_PLUS_EXPR, WIDEN_MULT_MINUS_EXPR): New codes. * cfgexpand.c (gimple_assign_rhs_to_tree): Likewise. (expand_gimple_stmt_1): Likewise. (expand_debug_expr): Support WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * tree-inline.c (estimate_operator_cost): Likewise. * gimple.c (extract_ops_from_tree_1): Renamed from extract_ops_from_tree. Add new arg for a third operand; fill it. (gimple_build_assign_stat): Support operations with three operands. (gimple_build_assign_with_ops_stat): Likewise. (gimple_assign_set_rhs_from_tree): Likewise. (gimple_assign_set_rhs_with_ops_1): Renamed from gimple_assign_set_rhs_with_ops. Add new arg for a third operand. (get_gimple_rhs_num_ops): Support GIMPLE_TERNARY_RHS. (get_gimple_rhs_num_ops): Handle WIDEN_MULT_PLUS_EXPR and WIDEN_MULT_MINUS_EXPR. * gimple.h (enum gimple_rhs_class): Add GIMPLE_TERNARY_RHS. (extract_ops_from_tree_1): Adjust declaration. (gimple_assign_set_rhs_with_ops_1): Likewise. (gimple_build_assign_with_ops): Pass NULL for last operand. (gimple_build_assign_with_ops3): New macro. (gimple_assign_rhs3, gimple_assign_rhs3_ptr, gimple_assign_set_rhs3, gimple_assign_set_rhs_with_ops, extract_ops_from_tree): New inline functions. * tree-cfg.c (verify_gimple_assign_ternary): New static function. (verify_gimple_assign): Call it. * doc/gimple.texi (Manipulating operands): Document GIMPLE_TERNARY_RHS. (Tuple specific accessors, subsection GIMPLE_ASSIGN): Document new functions for dealing with three-operand statements. * tree.c (commutative_ternary_tree_code): New function. * tree.h (commutative_ternary_tree_code): Declare it. * tree-vrp.c (gimple_assign_nonnegative_warnv_p): Return false for ternary statements. (gimple_assign_nonzero_warnv_p): Likewise. * tree-ssa-sccvn.c (stmt_has_constants): Handle GIMPLE_TERNARY_RHS. * tree-ssa-ccp.c (get_rhs_assign_op_for_ccp): New static function. (ccp_fold): Use it. Handle GIMPLE_TERNARY_RHS. * tree-ssa-dom.c (enum expr_kind): Add EXPR_TERNARY. (struct hashtable_expr): New member ternary in the union. (initialize_hash_element): Handle GIMPLE_TERNARY_RHS. (hashable_expr_equal_p): Fix indentation. Handle EXPR_TERNARY. (iterative_hash_hashable_expr): Likewise. (print_expr_hash_elt): Handle EXPR_TERNARY. * gimple-fold.c (fold_gimple_assign): Handle GIMPLE_TERNARY_RHS. * tree-ssa-threadedge.c (fold_assignment_stmt): Remove useless break statements. Handle GIMPLE_TERNARY_RHS. testsuite/ PR target/43902 * gcc.target/mips/madd-9.c: New test. From-SVN: r161366
2010-06-25 10:56:24 +02:00
else
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
icode = optab_handler (widen_pattern_optab, tmode0);
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
gcc_assert (icode != CODE_FOR_nothing);
if (nops >= 2)
{
oprnd1 = ops->op1;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
tmode1 = TYPE_MODE (TREE_TYPE (oprnd1));
}
/* The last operand is of a wider mode than the rest of the operands. */
if (nops == 2)
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
wmode = tmode1;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
else if (nops == 3)
{
gcc_assert (tmode1 == tmode0);
gcc_assert (op1);
oprnd2 = ops->op2;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
wmode = TYPE_MODE (TREE_TYPE (oprnd2));
}
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
op = 0;
create_output_operand (&eops[op++], target, TYPE_MODE (ops->type));
create_convert_operand_from (&eops[op++], op0, tmode0, unsignedp);
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
if (op1)
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_convert_operand_from (&eops[op++], op1, tmode1, unsignedp);
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
if (wide_op)
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_convert_operand_from (&eops[op++], wide_op, wmode, unsignedp);
expand_insn (icode, op, eops);
return eops[0].value;
Makefile.in (tree-vect-patterns.o): Add rule for new file. * Makefile.in (tree-vect-patterns.o): Add rule for new file. * tree-vect-analyze.c (vect_determine_vectorization_factor): Use existing STMT_VINFO_VECTYPE if available. (vect_mark_relevant): Add special handling for stmts that are marked as STMT_VINFO_IN_PATTERN_P. (vect_analyze_loop): Call vect_pattern_recog. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (in_pattern_p, related_stmt): New fields in stmt_info. (STMT_VINFO_IN_PATTERN_P, STMT_VINFO_RELATED_STMT): New macros. (vect_recog_func_ptr): New function-pointer type. * tree-vect-patterns.c: New file. (vect_recog_widen_sum_pattern, vect_recog_widen_mult_pattern): (vect_recog_dot_prod_pattern, vect_pattern_recog): (vect_pattern_recog_1): New functions. (vect_pattern_recog_funcs): New array of function pointers. * tree-vectorizer.h (ternary_op): New enum value. * tree-vect-transform.c (vect_create_epilog_for_reduction): Added declaration. Revised documentation. Removed redundant dump prints. Removed redundant argument. Added support for reduction patterns. (vectorizable_reduction): Added support for reduction patterns. (vect_transform_stmt): Added support for patterns. * expr.c (expand_expr_real_1): Added case for DOT_PROD_EXPR. * genopinit.c (udot_prod_optab, sdot_prod_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for DOT_PROD_EXPR. (expand_widen_pattern_expr): New function. (init_optabs): Initialize new optabs udot_prod_optab, sdot_prod_optab. * optabs.h (OTI_sdot_prod, OTI_udot_prod): New. (sdot_prod_optab, udot_prod_optab): Define new optabs. (expand_widen_pattern_expr): New function declaration. * tree.def (DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR): New tree-codes. * tree-inline.c (estimate_num_insns_1): Added cases for new tree-codes DOT_PROD_EXPR, WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-pretty-print.c (dump_generic_node): Likewise. (op_prio): Likewise. (op_symbol): Added cases for WIDEN_SUM_EXPR, WIDEN_MULT_EXPR. * tree-ssa-operands.c (get_expr_operands): Added case for DOT_PROD_EXPR. * tree-vect-patterns.c (widened_name_p): New function. (vect_recog_dot_prod_pattern): Added function implementation. * tree-vect-transform.c (get_initial_def_for_reduction): Added cases for DOT_PROD_EXPR, WIDEN_SUM_EXPR. * config/rs6000/altivec.md (udot_prod<mode>, sdot_prodv8hi): New. * config/i386/sse.md (sdot_prodv8hi, udot_prodv4si): New. * expr.c (expand_expr_real_1): Added case for WIDEN_SUM_EXPR. * genopinit.c (widen_ssum_optab, widen_usum_optab): Initialize. * optabs.c (optab_for_tree_code): Added case for WIDEN_SUM_EXPR. (init_optabs): Initialize new optabs widen_ssum_optab, widen_usum_optab. * optabs.h (OTI_widen_ssum, OTI_widen_usum): New. (widen_ssum_optab, widen_usum_optab): Define new optabs. * tree-vect-generic.c: (expand_vector_operations_1): Check type of use instead of type of def. * tree-vect-patterns.c (vect_recog_widen_sum_pattern): Added function implementation. * config/rs6000/altivec.md (widen_usum<mode>, widen_ssumv16qi, widen_ssumv8hi): New. * doc/tm.texi (ssum_widen, usum_widen, sdot_prod, udot_prod): New patterns. From-SVN: r109954
2006-01-19 11:24:00 +01:00
}
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
/* Generate code to perform an operation specified by TERNARY_OPTAB
on operands OP0, OP1 and OP2, 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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_ternary_op (machine_mode mode, optab ternary_optab, rtx op0,
rtx op1, rtx op2, rtx target, int unsignedp)
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[4];
enum insn_code icode = optab_handler (ternary_optab, mode);
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
gcc_assert (optab_handler (ternary_optab, mode) != CODE_FOR_nothing);
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, mode);
create_convert_operand_from (&ops[1], op0, mode, unsignedp);
create_convert_operand_from (&ops[2], op1, mode, unsignedp);
create_convert_operand_from (&ops[3], op2, mode, unsignedp);
expand_insn (icode, 4, ops);
return ops[0].value;
tree.def (ALIGN_INDIRECT_REF, [...]): New tree-codes. 2004-09-23 Dorit Naishlos <dorit@il.ibm.com> * tree.def (ALIGN_INDIRECT_REF, MISALIGNED_INDIRECT_REF): New tree-codes. * tree.h (REF_ORIGINAL): Consider ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF. * alias.c (get_alias_set, nonoverlapping_memrefs_p): Likewise. * emit-rtl.c (mem_expr_equal_p, set_mem_attributes_minus_bitpos): Likewise. * expr.c (safe_from_p, expand_expr_real_1, rewrite_address_base) (find_interesting_uses_address): Likewise. * fold-const.c (non_lvalue, operand_equal_p): Likewise. (build_fold_addr_expr_with_type): Likewise. * gimplify.c (gimplify_addr_expr, gimplify_expr): Likewise. * print-rtl.c (print_mem_expr): Likewise. * tree-dump.c (dequeue_and_dump): Likewise. * tree-eh.c (tree_could_trap_p): Likewise. * tree-gimple.c (is_gimple_addressable, get_base_address): Likewise. * tree-pretty-print.c (op_prio, op_symbol, dump_generic_node): Likewise. * tree-ssa-alias.c (find_ptr_dereference, ptr_is_dereferenced_by): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * tree-ssa-dom.c (record_equivalences_from_stmt): Likewise. * tree-ssa-loop-im.c (for_each_index, is_call_clobbered_ref): Likewise. * tree-ssa-loop-ivopts.c (find_interesting_uses_address): Likewise. (add_address_candidates, rewrite_address_base): Likewise. * tree-ssa-operands.c (get_expr_operands, get_indirect_ref_operands): Likewise. * tree.c (staticp, build1_stat): Likewise. * tree.def (REALIGN_LOAD_EXPR, REALIGN_STORE_EXPR): New tree-codes. * tree-pretty-print.c (dump_generic_node): Consider REALIGN_LOAD_EXPR. * tree-ssa-operands.c (get_expr_operands): Likewise. * expr.c (expand_expr_real_1): Likewise. * optabs.h (vec_realign_store_optab, vec_realign_load_optab): New optabs. (OTI_vec_realign_store, OTI_vec_realign_load): New optab_index values for the new optabs. (expand_ternary_op): New function. * genopinit.c (optabs): Handle the new optabs. * optabs.c (optab_for_tree_code): Add cases for the new tree-codes. (init_optabs): Initialize vec_realign_load_optab. (expand_ternary_op): New functions. * target-def.h (TARGET_VECTORIZE): New member for struct gcc_target. (TARGET_VECTORIZE_MISALIGNED_MEM_OK): New member for targetm.vectorize. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD): Likewise. (TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE): Likewise. * target.h (struct vectorize): New member for struct gcc_target. (misaligned_mem_ok): New member for targetm.vectorize. (builtin_mask_for_load): Likewise. (builtin_mask_for_store): Likewise. * targethooks.c (default_vect_misaligned_mem_ok): New function. * targethooks.h (default_vect_misaligned_mem_ok): New function. * config/rs6000/altivec.md (build_vector_mask_for_load): New define_expand. (vec_realign_load_v4si, vec_realign_load_v4sf, vec_realign_load_v8hi) (vec_realign_load_v16qi): New define_insn. * config/rs6000/rs6000.h (ALTIVEC_BUILTIN_MASK_FOR_LOAD): (ALTIVEC_BUILTIN_MASK_FOR_STORE): New target builtins. * config/rs6000/rs6000.c (altivec_builtin_mask_for_load): (altivec_builtin_mask_for_store): New variables. (rs6000_builtin_mask_for_load): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_LOAD. (rs6000_builtin_mask_for_store): New function. Implements TARGET_VECTORIZE_BUILTIN_MASK_FOR_STORE. (rs6000_expand_builtin): Expand the target builtins builtin_mask_for_load and builtin_mask_for_store. (altivec_init_builtins): Initialize the new target builtins. * config/i386/i386.c (ix86_misaligned_mem_ok): New function. Implements the target hook TARGET_VECTORIZE_MISALIGNED_MEM_OK. * tree-vectorizer.c (vect_create_data_ref): Renamed to vect_create_data_ref_ptr. Returns a pointer instead of an array-ref. (vect_create_addr_base_for_vector_ref): Additional argument (offset). (vectorizable_store): Call vect_create_data_ref_ptr with additional arguments, and create an indirect_ref with its return value data_ref. Check aligned_access_p. (vectorizable_load): Handle misaligned loads, using software-pipelined scheme with REALIGN_LOAD_EXPR and ALIGN_INDIRECT_REF if vec_realign_load_optab is supported, or using a scheme without software-pipelining with MISALIGNED_INDIRECT_REF if the target hook misaligned_mem_ok is supported. (vect_finish_stmt_generation): Typo. (vect_enhance_data_refs_alignment): Rename loop_vinfo to loop_info. (vect_analyze_data_refs_alignment): Don't fail vectorization in the presence of misaligned loads. (vect_analyze_data_ref_access): Add check for constant init. (vect_get_symbl_and_dr): Remove duplicate line. * tree-vectorizer.h (DR_MISALIGNMENT): Add comment. From-SVN: r87948
2004-09-23 16:34:35 +02:00
}
/* Like expand_binop, but return a constant rtx if the result can be
calculated at compile time. The arguments and return value are
otherwise the same as for expand_binop. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
simplify_expand_binop (machine_mode mode, optab binoptab,
rtx op0, rtx op1, rtx target, int unsignedp,
enum optab_methods methods)
{
if (CONSTANT_P (op0) && CONSTANT_P (op1))
{
rtx x = simplify_binary_operation (optab_to_code (binoptab),
mode, op0, op1);
if (x)
return x;
}
return expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods);
}
/* Like simplify_expand_binop, but always put the result in TARGET.
Return true if the expansion succeeded. */
bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
force_expand_binop (machine_mode mode, optab binoptab,
rtx op0, rtx op1, rtx target, int unsignedp,
enum optab_methods methods)
{
rtx x = simplify_expand_binop (mode, binoptab, op0, op1,
target, unsignedp, methods);
if (x == 0)
return false;
if (x != target)
emit_move_insn (target, x);
return true;
}
/* Create a new vector value in VMODE with all elements set to OP. The
mode of OP must be the element mode of VMODE. If OP is a constant,
then the return value will be a constant. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_vector_broadcast (machine_mode vmode, rtx op)
{
enum insn_code icode;
rtvec vec;
rtx ret;
int i, n;
gcc_checking_assert (VECTOR_MODE_P (vmode));
n = GET_MODE_NUNITS (vmode);
vec = rtvec_alloc (n);
for (i = 0; i < n; ++i)
RTVEC_ELT (vec, i) = op;
if (CONSTANT_P (op))
return gen_rtx_CONST_VECTOR (vmode, vec);
/* ??? If the target doesn't have a vec_init, then we have no easy way
of performing this operation. Most of this sort of generic support
is hidden away in the vector lowering support in gimple. */
icode = optab_handler (vec_init_optab, vmode);
if (icode == CODE_FOR_nothing)
return NULL;
ret = gen_reg_rtx (vmode);
emit_insn (GEN_FCN (icode) (ret, gen_rtx_PARALLEL (vmode, vec)));
return ret;
}
/* This subroutine of expand_doubleword_shift handles the cases in which
the effective shift value is >= BITS_PER_WORD. The arguments and return
value are the same as for the parent routine, except that SUPERWORD_OP1
is the shift count to use when shifting OUTOF_INPUT into INTO_TARGET.
INTO_TARGET may be null if the caller has decided to calculate it. */
static bool
expand_superword_shift (optab binoptab, rtx outof_input, rtx superword_op1,
rtx outof_target, rtx into_target,
int unsignedp, enum optab_methods methods)
{
if (into_target != 0)
if (!force_expand_binop (word_mode, binoptab, outof_input, superword_op1,
into_target, unsignedp, methods))
return false;
if (outof_target != 0)
{
/* For a signed right shift, we must fill OUTOF_TARGET with copies
of the sign bit, otherwise we must fill it with zeros. */
if (binoptab != ashr_optab)
emit_move_insn (outof_target, CONST0_RTX (word_mode));
else
if (!force_expand_binop (word_mode, binoptab,
outof_input, GEN_INT (BITS_PER_WORD - 1),
outof_target, unsignedp, methods))
return false;
}
return true;
}
/* This subroutine of expand_doubleword_shift handles the cases in which
the effective shift value is < BITS_PER_WORD. The arguments and return
value are the same as for the parent routine. */
static bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_subword_shift (machine_mode op1_mode, optab binoptab,
rtx outof_input, rtx into_input, rtx op1,
rtx outof_target, rtx into_target,
int unsignedp, enum optab_methods methods,
unsigned HOST_WIDE_INT shift_mask)
{
optab reverse_unsigned_shift, unsigned_shift;
rtx tmp, carries;
reverse_unsigned_shift = (binoptab == ashl_optab ? lshr_optab : ashl_optab);
unsigned_shift = (binoptab == ashl_optab ? ashl_optab : lshr_optab);
/* The low OP1 bits of INTO_TARGET come from the high bits of OUTOF_INPUT.
We therefore need to shift OUTOF_INPUT by (BITS_PER_WORD - OP1) bits in
the opposite direction to BINOPTAB. */
if (CONSTANT_P (op1) || shift_mask >= BITS_PER_WORD)
{
carries = outof_input;
2014-05-06 18:25:05 +02:00
tmp = immed_wide_int_const (wi::shwi (BITS_PER_WORD,
op1_mode), op1_mode);
tmp = simplify_expand_binop (op1_mode, sub_optab, tmp, op1,
0, true, methods);
}
else
{
/* We must avoid shifting by BITS_PER_WORD bits since that is either
the same as a zero shift (if shift_mask == BITS_PER_WORD - 1) or
has unknown behavior. Do a single shift first, then shift by the
remainder. It's OK to use ~OP1 as the remainder if shift counts
are truncated to the mode size. */
carries = expand_binop (word_mode, reverse_unsigned_shift,
outof_input, const1_rtx, 0, unsignedp, methods);
if (shift_mask == BITS_PER_WORD - 1)
{
2014-05-06 18:25:05 +02:00
tmp = immed_wide_int_const
(wi::minus_one (GET_MODE_PRECISION (op1_mode)), op1_mode);
tmp = simplify_expand_binop (op1_mode, xor_optab, op1, tmp,
0, true, methods);
}
else
{
2014-05-06 18:25:05 +02:00
tmp = immed_wide_int_const (wi::shwi (BITS_PER_WORD - 1,
op1_mode), op1_mode);
tmp = simplify_expand_binop (op1_mode, sub_optab, tmp, op1,
0, true, methods);
}
}
if (tmp == 0 || carries == 0)
return false;
carries = expand_binop (word_mode, reverse_unsigned_shift,
carries, tmp, 0, unsignedp, methods);
if (carries == 0)
return false;
/* Shift INTO_INPUT logically by OP1. This is the last use of INTO_INPUT
so the result can go directly into INTO_TARGET if convenient. */
tmp = expand_binop (word_mode, unsigned_shift, into_input, op1,
into_target, unsignedp, methods);
if (tmp == 0)
return false;
/* Now OR in the bits carried over from OUTOF_INPUT. */
if (!force_expand_binop (word_mode, ior_optab, tmp, carries,
into_target, unsignedp, methods))
return false;
/* Use a standard word_mode shift for the out-of half. */
if (outof_target != 0)
if (!force_expand_binop (word_mode, binoptab, outof_input, op1,
outof_target, unsignedp, methods))
return false;
return true;
}
/* Try implementing expand_doubleword_shift using conditional moves.
The shift is by < BITS_PER_WORD if (CMP_CODE CMP1 CMP2) is true,
otherwise it is by >= BITS_PER_WORD. SUBWORD_OP1 and SUPERWORD_OP1
are the shift counts to use in the former and latter case. All other
arguments are the same as the parent routine. */
static bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_doubleword_shift_condmove (machine_mode op1_mode, optab binoptab,
enum rtx_code cmp_code, rtx cmp1, rtx cmp2,
rtx outof_input, rtx into_input,
rtx subword_op1, rtx superword_op1,
rtx outof_target, rtx into_target,
int unsignedp, enum optab_methods methods,
unsigned HOST_WIDE_INT shift_mask)
{
rtx outof_superword, into_superword;
/* Put the superword version of the output into OUTOF_SUPERWORD and
INTO_SUPERWORD. */
outof_superword = outof_target != 0 ? gen_reg_rtx (word_mode) : 0;
if (outof_target != 0 && subword_op1 == superword_op1)
{
/* The value INTO_TARGET >> SUBWORD_OP1, which we later store in
OUTOF_TARGET, is the same as the value of INTO_SUPERWORD. */
into_superword = outof_target;
if (!expand_superword_shift (binoptab, outof_input, superword_op1,
outof_superword, 0, unsignedp, methods))
return false;
}
else
{
into_superword = gen_reg_rtx (word_mode);
if (!expand_superword_shift (binoptab, outof_input, superword_op1,
outof_superword, into_superword,
unsignedp, methods))
return false;
}
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
/* Put the subword version directly in OUTOF_TARGET and INTO_TARGET. */
if (!expand_subword_shift (op1_mode, binoptab,
outof_input, into_input, subword_op1,
outof_target, into_target,
unsignedp, methods, shift_mask))
return false;
/* Select between them. Do the INTO half first because INTO_SUPERWORD
might be the current value of OUTOF_TARGET. */
if (!emit_conditional_move (into_target, cmp_code, cmp1, cmp2, op1_mode,
into_target, into_superword, word_mode, false))
return false;
if (outof_target != 0)
if (!emit_conditional_move (outof_target, cmp_code, cmp1, cmp2, op1_mode,
outof_target, outof_superword,
word_mode, false))
return false;
return true;
}
/* Expand a doubleword shift (ashl, ashr or lshr) using word-mode shifts.
OUTOF_INPUT and INTO_INPUT are the two word-sized halves of the first
input operand; the shift moves bits in the direction OUTOF_INPUT->
INTO_TARGET. OUTOF_TARGET and INTO_TARGET are the equivalent words
of the target. OP1 is the shift count and OP1_MODE is its mode.
If OP1 is constant, it will have been truncated as appropriate
and is known to be nonzero.
If SHIFT_MASK is zero, the result of word shifts is undefined when the
shift count is outside the range [0, BITS_PER_WORD). This routine must
avoid generating such shifts for OP1s in the range [0, BITS_PER_WORD * 2).
If SHIFT_MASK is nonzero, all word-mode shift counts are effectively
masked by it and shifts in the range [BITS_PER_WORD, SHIFT_MASK) will
fill with zeros or sign bits as appropriate.
If SHIFT_MASK is BITS_PER_WORD - 1, this routine will synthesize
a doubleword shift whose equivalent mask is BITS_PER_WORD * 2 - 1.
Doing this preserves semantics required by SHIFT_COUNT_TRUNCATED.
In all other cases, shifts by values outside [0, BITS_PER_UNIT * 2)
are undefined.
BINOPTAB, UNSIGNEDP and METHODS are as for expand_binop. This function
may not use INTO_INPUT after modifying INTO_TARGET, and similarly for
OUTOF_INPUT and OUTOF_TARGET. OUTOF_TARGET can be null if the parent
function wants to calculate it itself.
Return true if the shift could be successfully synthesized. */
static bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_doubleword_shift (machine_mode op1_mode, optab binoptab,
rtx outof_input, rtx into_input, rtx op1,
rtx outof_target, rtx into_target,
int unsignedp, enum optab_methods methods,
unsigned HOST_WIDE_INT shift_mask)
{
rtx superword_op1, tmp, cmp1, cmp2;
enum rtx_code cmp_code;
/* See if word-mode shifts by BITS_PER_WORD...BITS_PER_WORD * 2 - 1 will
fill the result with sign or zero bits as appropriate. If so, the value
of OUTOF_TARGET will always be (SHIFT OUTOF_INPUT OP1). Recursively call
this routine to calculate INTO_TARGET (which depends on both OUTOF_INPUT
and INTO_INPUT), then emit code to set up OUTOF_TARGET.
This isn't worthwhile for constant shifts since the optimizers will
cope better with in-range shift counts. */
if (shift_mask >= BITS_PER_WORD
&& outof_target != 0
&& !CONSTANT_P (op1))
{
if (!expand_doubleword_shift (op1_mode, binoptab,
outof_input, into_input, op1,
0, into_target,
unsignedp, methods, shift_mask))
return false;
if (!force_expand_binop (word_mode, binoptab, outof_input, op1,
outof_target, unsignedp, methods))
return false;
return true;
}
/* Set CMP_CODE, CMP1 and CMP2 so that the rtx (CMP_CODE CMP1 CMP2)
is true when the effective shift value is less than BITS_PER_WORD.
Set SUPERWORD_OP1 to the shift count that should be used to shift
OUTOF_INPUT into INTO_TARGET when the condition is false. */
2014-05-06 18:25:05 +02:00
tmp = immed_wide_int_const (wi::shwi (BITS_PER_WORD, op1_mode), op1_mode);
if (!CONSTANT_P (op1) && shift_mask == BITS_PER_WORD - 1)
{
/* Set CMP1 to OP1 & BITS_PER_WORD. The result is zero iff OP1
is a subword shift count. */
cmp1 = simplify_expand_binop (op1_mode, and_optab, op1, tmp,
0, true, methods);
cmp2 = CONST0_RTX (op1_mode);
cmp_code = EQ;
superword_op1 = op1;
}
else
{
/* Set CMP1 to OP1 - BITS_PER_WORD. */
cmp1 = simplify_expand_binop (op1_mode, sub_optab, op1, tmp,
0, true, methods);
cmp2 = CONST0_RTX (op1_mode);
cmp_code = LT;
superword_op1 = cmp1;
}
if (cmp1 == 0)
return false;
/* If we can compute the condition at compile time, pick the
appropriate subroutine. */
tmp = simplify_relational_operation (cmp_code, SImode, op1_mode, cmp1, cmp2);
if (tmp != 0 && CONST_INT_P (tmp))
{
if (tmp == const0_rtx)
return expand_superword_shift (binoptab, outof_input, superword_op1,
outof_target, into_target,
unsignedp, methods);
else
return expand_subword_shift (op1_mode, binoptab,
outof_input, into_input, op1,
outof_target, into_target,
unsignedp, methods, shift_mask);
}
/* Try using conditional moves to generate straight-line code. */
if (HAVE_conditional_move)
{
rtx_insn *start = get_last_insn ();
if (expand_doubleword_shift_condmove (op1_mode, binoptab,
cmp_code, cmp1, cmp2,
outof_input, into_input,
op1, superword_op1,
outof_target, into_target,
unsignedp, methods, shift_mask))
return true;
delete_insns_since (start);
}
/* As a last resort, use branches to select the correct alternative. */
rtx_code_label *subword_label = gen_label_rtx ();
rtx_code_label *done_label = gen_label_rtx ();
NO_DEFER_POP;
do_compare_rtx_and_jump (cmp1, cmp2, cmp_code, false, op1_mode,
re PR middle-end/42233 (c++ builtin_expect code generation regression) PR middle-end/42233 * expr.h (jumpifnot, jumpifnot_1, jumpif, jumpif_1, do_jump, do_jump_1, do_compare_rtx_and_jump): Add PROB argument. * dojump.c: Include output.h. (inv): New inline function. (jumpifnot, jumpifnot_1, jumpif, jumpif_1, do_jump_1, do_jump, do_jump_by_parts_greater_rtx, do_jump_by_parts_greater, do_jump_by_parts_zero_rtx, do_jump_by_parts_equality_rtx, do_jump_by_parts_equality, do_compare_and_jump): Add PROB argument, pass it down to other calls. (do_compare_rtx_and_jump): Likewise. If PROB is not -1, add REG_BR_PROB note to the conditional jump. * cfgexpand.c (add_reg_br_prob_note): Removed. (expand_gimple_cond): Don't call it, add the probability as last argument to jumpif_1/jumpifnot_1. * Makefile.in (dojump.o): Depend on output.h. * builtins.c (expand_errno_check): Adjust do_compare_rtx_and_jump callers. * expmed.c (emit_store_flag_force, do_cmp_and_jump): Likewise. * stmt.c (do_jump_if_equal): Likewise. * cfgrtl.c (rtl_lv_add_condition_to_bb): Likewise. * loop-unswitch.c (compare_and_jump_seq): Likewise. * config/rs6000/rs6000.c (rs6000_aix_emit_builtin_unwind_init): Likewise. * optabs.c (expand_doubleword_shift, expand_abs): Likewise. * expr.c (expand_expr_real_1): Adjust do_jump, jumpifnot and jumpifnot_1 callers. (expand_expr_real_2): Adjust jumpifnot_1 and do_compare_rtx_and_jump callers. (store_expr): Adjust jumpifnot caller. (store_constructor): Adjust jumpif caller. From-SVN: r156889
2010-02-19 10:53:51 +01:00
0, 0, subword_label, -1);
OK_DEFER_POP;
if (!expand_superword_shift (binoptab, outof_input, superword_op1,
outof_target, into_target,
unsignedp, methods))
return false;
emit_jump_insn (targetm.gen_jump (done_label));
emit_barrier ();
emit_label (subword_label);
if (!expand_subword_shift (op1_mode, binoptab,
outof_input, into_input, op1,
outof_target, into_target,
unsignedp, methods, shift_mask))
return false;
emit_label (done_label);
return true;
}
/* Subroutine of expand_binop. Perform a double word multiplication of
operands OP0 and OP1 both of mode MODE, which is exactly twice as wide
as the target's word_mode. This function return NULL_RTX if anything
goes wrong, in which case it may have already emitted instructions
which need to be deleted.
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
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
multiplications.
The multiplication proceeds as follows:
_______________________
[__op0_high_|__op0_low__]
_______________________
* [__op1_high_|__op1_low__]
_______________________________________________
_______________________
(1) [__op0_low__*__op1_low__]
_______________________
(2a) [__op0_low__*__op1_high_]
_______________________
(2b) [__op0_high_*__op1_low__]
_______________________
(3) [__op0_high_*__op1_high_]
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. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_doubleword_mult (machine_mode mode, rtx op0, rtx op1, rtx target,
bool umulp, enum optab_methods methods)
{
int low = (WORDS_BIG_ENDIAN ? 1 : 0);
int high = (WORDS_BIG_ENDIAN ? 0 : 1);
rtx wordm1 = umulp ? NULL_RTX : GEN_INT (BITS_PER_WORD - 1);
rtx product, adjust, product_high, temp;
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);
/* If we're using an unsigned multiply to directly compute the product
of the low-order words of the operands and perform any required
adjustments of the operands, we begin 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 (!umulp)
{
/* ??? This could be done with emit_store_flag where available. */
temp = expand_binop (word_mode, lshr_optab, op0_low, wordm1,
NULL_RTX, 1, methods);
if (temp)
op0_high = expand_binop (word_mode, add_optab, op0_high, temp,
NULL_RTX, 0, OPTAB_DIRECT);
else
{
temp = expand_binop (word_mode, ashr_optab, op0_low, wordm1,
NULL_RTX, 0, methods);
if (!temp)
return NULL_RTX;
op0_high = expand_binop (word_mode, sub_optab, op0_high, temp,
NULL_RTX, 0, OPTAB_DIRECT);
}
if (!op0_high)
return NULL_RTX;
}
adjust = expand_binop (word_mode, smul_optab, op0_high, op1_low,
NULL_RTX, 0, OPTAB_DIRECT);
if (!adjust)
return NULL_RTX;
/* OP0_HIGH should now be dead. */
if (!umulp)
{
/* ??? This could be done with emit_store_flag where available. */
temp = expand_binop (word_mode, lshr_optab, op1_low, wordm1,
NULL_RTX, 1, methods);
if (temp)
op1_high = expand_binop (word_mode, add_optab, op1_high, temp,
NULL_RTX, 0, OPTAB_DIRECT);
else
{
temp = expand_binop (word_mode, ashr_optab, op1_low, wordm1,
NULL_RTX, 0, methods);
if (!temp)
return NULL_RTX;
op1_high = expand_binop (word_mode, sub_optab, op1_high, temp,
NULL_RTX, 0, OPTAB_DIRECT);
}
if (!op1_high)
return NULL_RTX;
}
temp = expand_binop (word_mode, smul_optab, op1_high, op0_low,
NULL_RTX, 0, OPTAB_DIRECT);
if (!temp)
return NULL_RTX;
/* OP1_HIGH should now be dead. */
adjust = expand_binop (word_mode, add_optab, adjust, temp,
NULL_RTX, 0, OPTAB_DIRECT);
if (target && !REG_P (target))
target = NULL_RTX;
if (umulp)
product = expand_binop (mode, umul_widen_optab, op0_low, op1_low,
target, 1, OPTAB_DIRECT);
else
product = expand_binop (mode, smul_widen_optab, op0_low, op1_low,
target, 1, OPTAB_DIRECT);
if (!product)
return NULL_RTX;
product_high = operand_subword (product, high, 1, mode);
adjust = expand_binop (word_mode, add_optab, product_high, adjust,
NULL_RTX, 0, OPTAB_DIRECT);
emit_move_insn (product_high, adjust);
return product;
}
/* 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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_simple_binop (machine_mode mode, enum rtx_code code, rtx op0,
rtx op1, rtx target, int unsignedp,
enum optab_methods methods)
{
optab binop = code_to_optab (code);
gcc_assert (binop);
return expand_binop (mode, binop, op0, op1, target, unsignedp, methods);
}
/* Return whether OP0 and OP1 should be swapped when expanding a commutative
binop. Order them according to commutative_operand_precedence and, if
possible, try to put TARGET or a pseudo first. */
static bool
swap_commutative_operands_with_target (rtx target, rtx op0, rtx op1)
{
int op0_prec = commutative_operand_precedence (op0);
int op1_prec = commutative_operand_precedence (op1);
if (op0_prec < op1_prec)
return true;
if (op0_prec > op1_prec)
return false;
/* With equal precedence, both orders are ok, but it is better if the
first operand is TARGET, or if both TARGET and OP0 are pseudos. */
if (target == 0 || REG_P (target))
return (REG_P (op1) && !REG_P (op0)) || target == op1;
else
return rtx_equal_p (op1, target);
}
/* Return true if BINOPTAB implements a shift operation. */
static bool
shift_optab_p (optab binoptab)
{
switch (optab_to_code (binoptab))
{
case ASHIFT:
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
case SS_ASHIFT:
case US_ASHIFT:
case ASHIFTRT:
case LSHIFTRT:
case ROTATE:
case ROTATERT:
return true;
default:
return false;
}
}
/* Return true if BINOPTAB implements a commutative binary operation. */
static bool
commutative_optab_p (optab binoptab)
{
return (GET_RTX_CLASS (optab_to_code (binoptab)) == RTX_COMM_ARITH
|| binoptab == smul_widen_optab
|| binoptab == umul_widen_optab
|| binoptab == smul_highpart_optab
|| binoptab == umul_highpart_optab);
}
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
/* X is to be used in mode MODE as operand OPN to BINOPTAB. If we're
optimizing, and if the operand is a constant that costs more than
1 instruction, force the constant into a register and return that
register. Return X otherwise. UNSIGNEDP says whether X is unsigned. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
avoid_expensive_constant (machine_mode mode, optab binoptab,
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
int opn, rtx x, bool unsignedp)
{
bool speed = optimize_insn_for_speed_p ();
if (mode != VOIDmode
&& optimize
&& CONSTANT_P (x)
target.def (rtx_costs): Remove "code" param, add "mode". * target.def (rtx_costs): Remove "code" param, add "mode". * rtl.h (rtx_cost, get_full_rtx_cost): Update prototype. (set_src_cost, get_full_set_src_cost): Likewise. Move later in file. (set_rtx_cost, get_full_set_rtx_cost): Move later in file. * rtlanal.c (rtx_cost): Add "mode" parameter. Update targetm.rtx_costs call. Track mode when given in rtx. (get_full_rtx_cost): Add "mode" parameter. Update rtx_cost calls. (default_address_cost): Pass Pmode to rtx_cost. (insn_rtx_cost): Pass dest mode of set to set_src_cost. * cprop.c (try_replace_reg): Ensure set_rtx_cost is not called with NULL set. * cse.c (COST, COST_IN): Add MODE param. Update all uses. (notreg_cost): Add mode param. Use it. * gcse.c (want_to_gcse_p): Delete forward declaration. Add mode param and pass to set_src_cost. Update all calls. (hash_scan_set): Formatting. * hooks.c (hook_bool_rtx_int_int_int_intp_bool_false): Delete. (hook_bool_rtx_mode_int_int_intp_bool_false): New function. * hooks.h: Ditto. * expmed.c (init_expmed_one_conv, init_expmed_one_mode, init_expmed, expand_mult, mult_by_coeff_cost, expand_smod_pow2, emit_store_flag): Update set_src_cost and rtx_cost calls. * auto-inc-dec.c (attempt_change): Likewise. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction, force_to_mode, distribute_and_simplify_rtx): Likewise. * dojump.c (prefer_and_bit_test): Likewise. * dse.c (find_shift_sequence): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * lower-subreg.c (shift_cost, compute_costs): Likewise. * optabs.c (avoid_expensive_constant, prepare_cmp_insn, lshift_cheap_p): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns, note_reg_elim_costly): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Delete "code" param, add "mode" param. Use "mode: in place of GET_MODE (x). Pass mode to rtx_cost calls. * config/alpha/alpha.c (alpha_rtx_costs): Likewise. * config/arc/arc.c (arc_rtx_costs): Likewise. * config/arm/arm.c (arm_rtx_costs): Likewise. * config/avr/avr.c (avr_rtx_costs, avr_rtx_costs_1): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/epiphany/epiphany.c (epiphany_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_rtx_costs): Likewise. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_rtx_costs): Likewise. * config/msp430/msp430.c (msp430_rtx_costs): Likewise. * config/nds32/nds32-cost.c (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32-protos.h (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32.c (nds32_rtx_costs): Likewise. * config/nios2/nios2.c (nios2_rtx_costs): Likewise. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/rl78/rl78.c (rl78_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/tilegx/tilegx.c (tilegx_rtx_costs): Likewise. * config/tilepro/tilepro.c (tilepro_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/visium/visium.c (visium_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Change type of "code" param, and pass as outer_code to first rtx_cost call. Pass mode to rtx_cost calls. (aarch64_address_cost, aarch64_if_then_else_costs): Update rtx_cost calls. (aarch64_rtx_costs_wrapper): Update. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs, arm_unspec_cost, arm_new_rtx_costs, arm_slowmul_rtx_costs): Update rtx_cost calls. * config/avr/avr.c (avr_final_prescan_insn): Update set_src_cost and rtx_cost calls. (avr_operand_rtx_cost): Similarly. (avr_rtx_costs_1): Correct mode passed to avr_operand_rtx_cost for subexpressions of ZERO_EXTEND, SIGN_EXTEND and COMPARE. * config/mips/mips.c (mips_stack_address_p): Comment typo. (mips_binary_cost): Update rtx_cost and set_src_cost calls. (mips_rtx_costs): Use GET_MODE (x) to detect const_int. * config/mn10300/mn10300.c (mn10300_address_cost): Pass Pmode to rtx_cost. (mn10300_rtx_costs): Correct mode passed to mn10300_address_cost. * config/rs6000/rs6000.c (rs6000_debug_rtx_costs): Update. * config/sh/sh.c (and_xor_ior_costs): Update rtx_cost call. * doc/tm.texi: Regenerate. From-SVN: r225532
2015-07-08 05:02:27 +02:00
&& (rtx_cost (x, mode, optab_to_code (binoptab), opn, speed)
> set_src_cost (x, mode, speed)))
{
if (CONST_INT_P (x))
{
HOST_WIDE_INT intval = trunc_int_for_mode (INTVAL (x), mode);
if (intval != INTVAL (x))
x = GEN_INT (intval);
}
else
x = convert_modes (mode, VOIDmode, x, unsignedp);
x = force_reg (mode, x);
}
return x;
}
/* Helper function for expand_binop: handle the case where there
is an insn that directly implements the indicated operation.
Returns null if this is not possible. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_binop_directly (machine_mode mode, optab binoptab,
rtx op0, rtx op1,
rtx target, int unsignedp, enum optab_methods methods,
rtx_insn *last)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode from_mode = widened_mode (mode, op0, op1);
enum insn_code icode = find_widening_optab_handler (binoptab, mode,
from_mode, 1);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode xmode0 = insn_data[(int) icode].operand[1].mode;
machine_mode xmode1 = insn_data[(int) icode].operand[2].mode;
machine_mode mode0, mode1, tmp_mode;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[3];
bool commutative_p;
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
rtx_insn *pat;
rtx xop0 = op0, xop1 = op1;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* If it is a commutative operator and the modes would match
if we would swap the operands, we can save the conversions. */
commutative_p = commutative_optab_p (binoptab);
if (commutative_p
&& GET_MODE (xop0) != xmode0 && GET_MODE (xop1) != xmode1
&& GET_MODE (xop0) == xmode1 && GET_MODE (xop1) == xmode1)
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (xop0, xop1);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
/* If we are optimizing, force expensive constants into a register. */
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
xop0 = avoid_expensive_constant (xmode0, binoptab, 0, xop0, unsignedp);
if (!shift_optab_p (binoptab))
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
xop1 = avoid_expensive_constant (xmode1, binoptab, 1, xop1, unsignedp);
/* 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
that they're properly zero-extended, sign-extended or truncated
for their mode. */
mode0 = GET_MODE (xop0) != VOIDmode ? GET_MODE (xop0) : mode;
if (xmode0 != VOIDmode && xmode0 != mode0)
{
xop0 = convert_modes (xmode0, mode0, xop0, unsignedp);
mode0 = xmode0;
}
mode1 = GET_MODE (xop1) != VOIDmode ? GET_MODE (xop1) : mode;
if (xmode1 != VOIDmode && xmode1 != mode1)
{
xop1 = convert_modes (xmode1, mode1, xop1, unsignedp);
mode1 = xmode1;
}
/* 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. */
if (commutative_p
&& swap_commutative_operands_with_target (target, xop0, xop1))
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (xop0, xop1);
/* Now, if insn's predicates don't allow our operands, put them into
pseudo regs. */
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (binoptab == vec_pack_trunc_optab
|| binoptab == vec_pack_usat_optab
|| binoptab == vec_pack_ssat_optab
|| binoptab == vec_pack_ufix_trunc_optab
|| binoptab == vec_pack_sfix_trunc_optab)
{
/* The mode of the result is different then the mode of the
arguments. */
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
tmp_mode = insn_data[(int) icode].operand[0].mode;
if (GET_MODE_NUNITS (tmp_mode) != 2 * GET_MODE_NUNITS (mode))
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
{
delete_insns_since (last);
return NULL_RTX;
}
}
else
tmp_mode = mode;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, tmp_mode);
create_input_operand (&ops[1], xop0, mode0);
create_input_operand (&ops[2], xop1, mode1);
pat = maybe_gen_insn (icode, 3, ops);
if (pat)
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
{
/* If PAT is composed of more than one insn, try to add an appropriate
REG_EQUAL note to it. If we can't because TEMP conflicts with an
operand, call expand_binop again, this time without a target. */
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& ! add_equal_note (pat, ops[0].value,
Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ 2014-08-28 David Malcolm <dmalcolm@redhat.com> * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise for local "insn". (define_expand "umulsi3_highpart"): Likewise for local "insn". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_insn): Likewise. (prev_nonnote_nondebug_insn): Likewise. (next_real_insn): Likewise. (prev_real_insn): Likewise. (next_active_insn): Likewise. (prev_active_insn): Likewise. (next_cc0_user): Likewise. Use rtx_sequence and a method for clarity. (prev_cc0_setter): Likewise. (try_split): Rename param "trial" to "uncast_trial" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping checked casts made redundant by this change. Strengthen locals "seq", "tem", "insn_last", "insn", "next" from rtx to rtx_insn *. (remove_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. (emit_pattern_after_setloc): Likewise for param "after", as "uncast_after". (emit_pattern_after): Likewise. Strengthen local "prev" from rtx to rtx_insn *. (emit_pattern_before_setloc): Rename param "before" to "uncast_before" and reintroduce "before" as a local rtx_insn * using a checked cast. Strengthen locals "first", "last" from rtx to rtx_insn *. (emit_pattern_before): Likewise rename/cast param "before" to "uncast_before". Strengthen local "next" from rtx to rtx_insn *. * except.c (copy_reg_eh_region_note_forward): Strengthen param "first" and local "insn" from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise for param "last" and local "insn". * expr.c (fixup_args_size_notes): Rename param "last" to "uncast_last" and reintroduce "last" as a local rtx_insn * using a checked cast. Strengthen local "insn" from rtx to rtx_insn *. * function.c (set_insn_locations): Strengthen param "insn" from rtx to rtx_insn *. (record_insns): Likewise for param "insns" and local "tmp". (active_insn_between): Rename param "tail" to "uncast_tail" and reintroduce "tail" as a local rtx_insn * using a checked cast. (thread_prologue_and_epilogue_insns): Split out top-level local rtx "seq" into three different rtx_insn * locals. Strengthen local "prologue_seq" from rtx to rtx_insn *. * gcse.c (insert_insn_end_basic_block): Strenghen local "insn" from rtx to rtx_insn *. * haifa-sched.c (initiate_bb_reg_pressure_info): Likewise. (priority): Likewise for locals "prev_first", "twin". (setup_insn_max_reg_pressure): Likewise for param "after". (sched_setup_bb_reg_pressure_info): Likewise. (no_real_insns_p): Strengthen params from const_rtx to const rtx_insn *. (schedule_block): Strengthen local "next_tail" from rtx to rtx_insn *. * ifcvt.c (find_active_insn_before): Strengthen return type and param "insn" from rtx to rtx_insn *. (find_active_insn_after): Likewise. (cond_exec_process_insns): Likewise for param "start" and local "insn". (cond_exec_process_if_block): Likewise for locals "then_start", "then_end", "else_start", "else_end", "insn", "start", "end", "from". (noce_process_if_block): Likewise for local "jump". (merge_if_block): Likewise for two locals named "end". (cond_exec_find_if_block): Likewise for local "last_insn". * jump.c (delete_related_insns): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. Strengthen local "p" from rtx to rtx_insn *. * lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with NULL. (split_reg): Likewise. * lra.c (lra_process_new_insns): Likewise. * modulo-sched.c (permute_partial_schedule): Strengthen param "last" from rtx to rtx_insn *. * optabs.c (add_equal_note): Likewise for param "insns" and local "last_insn". (expand_binop_directly): Add checked casts to rtx_insn * within NEXT_INSN (pat) uses. (expand_unop_direct): Likewise. (maybe_emit_unop_insn): Likewise. * recog.c (peep2_attempt): Strengthen locals "last", "before_try", "x" from rtx to rtx_insn *. * reorg.c (optimize_skip): Strengthen return type and local "delay_list" from rtx to rtx_insn_list *. Strengthen param "insn" and locals "trial", "next_trial" from rtx to rtx_insn *. * resource.c (next_insn_no_annul): Strengthen return type and param "insn" from rtx to rtx_insn *. Use a cast to and method of rtx_sequence to clarify the code. (mark_referenced_resources): Add a checked cast to rtx_insn * within PREV_INSN (x). (find_dead_or_set_registers): Strengthen return type, param "target", locals "insn", "next", "jump_insn", "this_jump_insn" from rtx to rtx_insn *. Strengthen param "jump_target" from rtx * to rtx_insn **. (mark_target_live_regs): Strengthen params "insns" and "target", locals "insn", "jump_target", "start_insn", "stop_insn" from rtx to rtx_insn *. Use cast to and method of rtx_sequence to clarify the code. * resource.h (mark_target_live_regs): Strengthen params 1 and 2 from rtx to rtx_insn *. * rtl.h (copy_reg_eh_region_note_forward): Strengthen second param from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise. (unshare_all_rtl_in_chain): Likewise for sole param. (dump_rtl_slim): Strengthen second and third params from const_rtx to const rtx_insn *. * sched-deps.c (sched_free_deps): Strengthen params "head" and "tail" and locals "insn", "next_tail" from rtx to rtx_insn *. * sched-ebb.c (init_ready_list): Strengthen locals "prev_head", "next_tail" from rtx to rtx_insn *. (begin_move_insn): Likewise for local "next". * sched-int.h (sched_free_deps): Likewise for first and second params. (no_real_insns_p): Strengthen both params from const_rtx to const rtx_insn *. (sched_setup_bb_reg_pressure_info): Strengthen second params from rtx to rtx_insn *. * sched-rgn.c (init_ready_list): Likewise for locals "prev_head", "next_tail". * sched-vis.c (dump_rtl_slim): Strengthen params "first", "last" and locals "insn", "tail" from const_rtx to const rtx_insn *. (rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to rtx_insn *. (debug_rtl_slim): Strengthen params "first" and "last" from const_rtx to const rtx_insn *. * shrink-wrap.c (try_shrink_wrapping): Strengthen param "prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *. (convert_to_simple_return): Likewise for param "returnjump". * shrink-wrap.h (try_shrink_wrapping): Likewise for param "prologue_seq". (convert_to_simple_return): Likewise for param "returnjump". * valtrack.c (propagate_for_debug): Likewise for params "insn", "last". * valtrack.h (propagate_for_debug): Likewise for second param. From-SVN: r214693
2014-08-28 22:45:40 +02:00
optab_to_code (binoptab),
ops[1].value, ops[2].value))
{
delete_insns_since (last);
return expand_binop (mode, binoptab, op0, op1, NULL_RTX,
unsignedp, methods);
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
emit_insn (pat);
return ops[0].value;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
}
delete_insns_since (last);
return NULL_RTX;
}
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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_binop (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
{
enum optab_methods next_methods
= (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN
? OPTAB_WIDEN : methods);
enum mode_class mclass;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx libfunc;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx temp;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *entry_last = get_last_insn ();
rtx_insn *last;
1991-12-30 04:19:53 +01:00
mclass = GET_MODE_CLASS (mode);
1991-12-30 04:19:53 +01:00
/* If subtracting an integer constant, convert this into an addition of
the negated constant. */
if (binoptab == sub_optab && CONST_INT_P (op1))
{
op1 = negate_rtx (mode, op1);
binoptab = add_optab;
}
1991-12-30 04:19:53 +01:00
/* Record where to delete back to if we backtrack. */
last = get_last_insn ();
/* If we can do it with a three-operand insn, do so. */
if (methods != OPTAB_MUST_WIDEN
&& find_widening_optab_handler (binoptab, mode,
widened_mode (mode, op0, op1), 1)
!= CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
temp = expand_binop_directly (mode, binoptab, op0, op1, target,
unsignedp, methods, last);
if (temp)
return temp;
1991-12-30 04:19:53 +01:00
}
/* If we were trying to rotate, and that didn't work, try rotating
the other direction before falling back to shifts and bitwise-or. */
if (((binoptab == rotl_optab
&& optab_handler (rotr_optab, mode) != CODE_FOR_nothing)
|| (binoptab == rotr_optab
&& optab_handler (rotl_optab, mode) != CODE_FOR_nothing))
&& mclass == MODE_INT)
{
optab otheroptab = (binoptab == rotl_optab ? rotr_optab : rotl_optab);
rtx newop1;
unsigned int bits = GET_MODE_PRECISION (mode);
if (CONST_INT_P (op1))
newop1 = GEN_INT (bits - INTVAL (op1));
else if (targetm.shift_truncation_mask (mode) == bits - 1)
newop1 = negate_rtx (GET_MODE (op1), op1);
else
newop1 = expand_binop (GET_MODE (op1), sub_optab,
gen_int_mode (bits, GET_MODE (op1)), op1,
NULL_RTX, unsignedp, OPTAB_DIRECT);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
temp = expand_binop_directly (mode, otheroptab, op0, newop1,
target, unsignedp, methods, last);
if (temp)
return temp;
}
/* 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_2XWIDER_MODE (mode) != VOIDmode
&& (widening_optab_handler ((unsignedp ? umul_widen_optab
: smul_widen_optab),
GET_MODE_2XWIDER_MODE (mode), mode)
!= CODE_FOR_nothing))
{
temp = expand_binop (GET_MODE_2XWIDER_MODE (mode),
unsignedp ? umul_widen_optab : smul_widen_optab,
op0, op1, NULL_RTX, unsignedp, OPTAB_DIRECT);
if (temp != 0)
{
if (GET_MODE_CLASS (mode) == MODE_INT
&& TRULY_NOOP_TRUNCATION_MODES_P (mode, GET_MODE (temp)))
return gen_lowpart (mode, temp);
else
return convert_to_mode (mode, temp, unsignedp);
}
}
/* If this is a vector shift by a scalar, see if we can do a vector
shift by a vector. If so, broadcast the scalar into a vector. */
if (mclass == MODE_VECTOR_INT)
{
optab otheroptab = unknown_optab;
if (binoptab == ashl_optab)
otheroptab = vashl_optab;
else if (binoptab == ashr_optab)
otheroptab = vashr_optab;
else if (binoptab == lshr_optab)
otheroptab = vlshr_optab;
else if (binoptab == rotl_optab)
otheroptab = vrotl_optab;
else if (binoptab == rotr_optab)
otheroptab = vrotr_optab;
if (otheroptab && optab_handler (otheroptab, mode) != CODE_FOR_nothing)
{
rtx vop1 = expand_vector_broadcast (mode, op1);
if (vop1)
{
temp = expand_binop_directly (mode, otheroptab, op0, vop1,
target, unsignedp, methods, last);
if (temp)
return temp;
}
}
}
/* Look for a wider mode of the same class for which we think we
can open-code the operation. Check for a widening multiply at the
wider mode as well. */
if (CLASS_HAS_WIDER_MODES_P (mclass)
&& methods != OPTAB_DIRECT && methods != OPTAB_LIB)
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
if (optab_handler (binoptab, wider_mode) != CODE_FOR_nothing
|| (binoptab == smul_optab
&& GET_MODE_WIDER_MODE (wider_mode) != VOIDmode
&& (find_widening_optab_handler ((unsignedp
? umul_widen_optab
: smul_widen_optab),
GET_MODE_WIDER_MODE (wider_mode),
mode, 0)
!= CODE_FOR_nothing)))
{
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
the results to the same narrowness. */
if ((binoptab == ior_optab || binoptab == and_optab
|| binoptab == xor_optab
|| binoptab == add_optab || binoptab == sub_optab
|| binoptab == smul_optab || binoptab == ashl_optab)
&& mclass == MODE_INT)
{
no_extend = 1;
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
xop0 = avoid_expensive_constant (mode, binoptab, 0,
xop0, unsignedp);
if (binoptab != ashl_optab)
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
xop1 = avoid_expensive_constant (mode, binoptab, 1,
xop1, unsignedp);
}
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp, no_extend);
/* The second operand of a shift must always be extended. */
xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
no_extend && binoptab != ashl_optab);
1992-07-06 22:04:10 +02:00
temp = expand_binop (wider_mode, binoptab, xop0, xop1, NULL_RTX,
unsignedp, OPTAB_DIRECT);
if (temp)
{
if (mclass != MODE_INT
|| !TRULY_NOOP_TRUNCATION_MODES_P (mode, wider_mode))
{
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);
}
}
/* 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. */
if (commutative_optab_p (binoptab)
&& swap_commutative_operands_with_target (target, op0, op1))
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (op0, op1);
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)
&& mclass == MODE_INT
1991-12-30 04:19:53 +01:00
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& optab_handler (binoptab, word_mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
int i;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
1991-12-30 04:19:53 +01:00
/* 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
|| !valid_multiword_target_p (target))
1991-12-30 04:19:53 +01:00
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);
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),
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 ();
if (i == GET_MODE_BITSIZE (mode) / BITS_PER_WORD)
{
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
emit_insn (insns);
return target;
}
1991-12-30 04:19:53 +01:00
}
/* Synthesize double word shifts from single word shifts. */
if ((binoptab == lshr_optab || binoptab == ashl_optab
|| binoptab == ashr_optab)
&& mclass == MODE_INT
&& (CONST_INT_P (op1) || optimize_insn_for_speed_p ())
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
&& GET_MODE_PRECISION (mode) == GET_MODE_BITSIZE (mode)
&& optab_handler (binoptab, word_mode) != CODE_FOR_nothing
&& optab_handler (ashl_optab, word_mode) != CODE_FOR_nothing
&& optab_handler (lshr_optab, word_mode) != CODE_FOR_nothing)
{
unsigned HOST_WIDE_INT shift_mask, double_shift_mask;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode op1_mode;
double_shift_mask = targetm.shift_truncation_mask (mode);
shift_mask = targetm.shift_truncation_mask (word_mode);
op1_mode = GET_MODE (op1) != VOIDmode ? GET_MODE (op1) : word_mode;
/* Apply the truncation to constant shifts. */
if (double_shift_mask > 0 && CONST_INT_P (op1))
op1 = GEN_INT (INTVAL (op1) & double_shift_mask);
if (op1 == CONST0_RTX (op1_mode))
return op0;
/* Make sure that this is a combination that expand_doubleword_shift
can handle. See the comments there for details. */
if (double_shift_mask == 0
|| (shift_mask == BITS_PER_WORD - 1
&& double_shift_mask == BITS_PER_WORD * 2 - 1))
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
rtx into_target, outof_target;
rtx into_input, outof_input;
int 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
|| !valid_multiword_target_p (target))
target = gen_reg_rtx (mode);
start_sequence ();
/* 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 == ashl_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 (expand_doubleword_shift (op1_mode, binoptab,
outof_input, into_input, op1,
outof_target, into_target,
unsignedp, next_methods, shift_mask))
{
insns = get_insns ();
end_sequence ();
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
emit_insn (insns);
return target;
}
end_sequence ();
}
}
/* Synthesize double word rotates from single word shifts. */
if ((binoptab == rotl_optab || binoptab == rotr_optab)
&& mclass == MODE_INT
&& CONST_INT_P (op1)
&& GET_MODE_PRECISION (mode) == 2 * BITS_PER_WORD
&& optab_handler (ashl_optab, word_mode) != CODE_FOR_nothing
&& optab_handler (lshr_optab, word_mode) != CODE_FOR_nothing)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
rtx into_target, outof_target;
rtx into_input, outof_input;
rtx inter;
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. Do this also if target is not
a REG, first because having a register instead may open optimization
opportunities, and second because if target and op0 happen to be MEMs
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)
|| !valid_multiword_target_p (target))
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);
inter = const0_rtx;
}
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);
second_shift_count = GEN_INT (2 * BITS_PER_WORD - shift_count);
}
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,
NULL_RTX, unsignedp, next_methods);
into_temp2 = expand_binop (word_mode, reverse_unsigned_shift,
into_input, second_shift_count,
NULL_RTX, unsignedp, next_methods);
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;
if (inter != 0 && inter != into_target)
emit_move_insn (into_target, inter);
outof_temp1 = expand_binop (word_mode, unsigned_shift,
into_input, first_shift_count,
NULL_RTX, unsignedp, next_methods);
outof_temp2 = expand_binop (word_mode, reverse_unsigned_shift,
outof_input, second_shift_count,
NULL_RTX, unsignedp, next_methods);
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);
if (inter != 0 && inter != outof_target)
emit_move_insn (outof_target, inter);
}
insns = get_insns ();
end_sequence ();
if (inter != 0)
{
emit_insn (insns);
return target;
}
}
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)
&& mclass == MODE_INT
1991-12-30 04:19:53 +01:00
&& GET_MODE_SIZE (mode) >= 2 * UNITS_PER_WORD
&& optab_handler (binoptab, word_mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
unsigned int i;
1991-12-30 04:19:53 +01:00
optab otheroptab = binoptab == add_optab ? sub_optab : add_optab;
const unsigned int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD;
rtx carry_in = NULL_RTX, carry_out = NULL_RTX;
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. */
xop0 = force_reg (mode, op0);
xop1 = force_reg (mode, op1);
1991-12-30 04:19:53 +01:00
xtarget = gen_reg_rtx (mode);
if (target == 0 || !REG_P (target) || !valid_multiword_target_p (target))
target = xtarget;
1991-12-30 04:19:53 +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))
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_clobber (xtarget);
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);
rtx target_piece = operand_subword (xtarget, index, 1, mode);
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. */
x = expand_binop (word_mode, binoptab,
1991-12-30 04:19:53 +01:00
op0_piece, op1_piece,
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. */
carry_out = gen_reg_rtx (word_mode);
carry_out = emit_store_flag_force (carry_out,
(binoptab == add_optab
? LT : GT),
x, op0_piece,
word_mode, 1, normalizep);
1991-12-30 04:19:53 +01:00
}
if (i > 0)
{
rtx newx;
1991-12-30 04:19:53 +01:00
/* Add/subtract previous carry to main result. */
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. */
rtx carry_tmp = gen_reg_rtx (word_mode);
carry_tmp = emit_store_flag_force (carry_tmp,
(binoptab == add_optab
? LT : GT),
newx, x,
word_mode, 1, normalizep);
1991-12-30 04:19:53 +01:00
/* Logical-ior the two poss. carry together. */
carry_out = expand_binop (word_mode, ior_optab,
1991-12-30 04:19:53 +01:00
carry_out, carry_tmp,
carry_out, 0, next_methods);
if (carry_out == 0)
1991-12-30 04:19:53 +01:00
break;
}
emit_move_insn (target_piece, newx);
1991-12-30 04:19:53 +01:00
}
else
{
if (x != target_piece)
emit_move_insn (target_piece, x);
}
1991-12-30 04:19:53 +01:00
carry_in = carry_out;
}
1991-12-30 04:19:53 +01:00
if (i == GET_MODE_BITSIZE (mode) / (unsigned) BITS_PER_WORD)
1991-12-30 04:19:53 +01:00
{
if (optab_handler (mov_optab, mode) != CODE_FOR_nothing
|| ! rtx_equal_p (target, xtarget))
{
rtx_insn *temp = emit_move_insn (target, xtarget);
set_dst_reg_note (temp, REG_EQUAL,
gen_rtx_fmt_ee (optab_to_code (binoptab),
mode, copy_rtx (xop0),
copy_rtx (xop1)),
target);
}
else
target = xtarget;
1991-12-30 04:19:53 +01:00
return target;
}
1991-12-30 04:19:53 +01:00
else
delete_insns_since (last);
}
/* Attempt to synthesize double word multiplies using a sequence of word
mode multiplications. We first attempt to generate a sequence using a
more efficient unsigned widening multiply, and if that fails we then
try using a signed widening multiply. */
1991-12-30 04:19:53 +01:00
if (binoptab == smul_optab
&& mclass == MODE_INT
1991-12-30 04:19:53 +01:00
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
&& optab_handler (smul_optab, word_mode) != CODE_FOR_nothing
&& optab_handler (add_optab, word_mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
rtx product = NULL_RTX;
if (widening_optab_handler (umul_widen_optab, mode, word_mode)
!= CODE_FOR_nothing)
{
product = expand_doubleword_mult (mode, op0, op1, target,
true, methods);
if (!product)
1991-12-30 04:19:53 +01:00
delete_insns_since (last);
}
if (product == NULL_RTX
&& widening_optab_handler (smul_widen_optab, mode, word_mode)
!= CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
product = expand_doubleword_mult (mode, op0, op1, target,
false, methods);
if (!product)
delete_insns_since (last);
1991-12-30 04:19:53 +01:00
}
if (product != NULL_RTX)
1991-12-30 04:19:53 +01:00
{
if (optab_handler (mov_optab, mode) != CODE_FOR_nothing)
{
temp = emit_move_insn (target ? target : product, product);
set_dst_reg_note (temp,
REG_EQUAL,
gen_rtx_fmt_ee (MULT, mode,
copy_rtx (op0),
copy_rtx (op1)),
target ? target : product);
1991-12-30 04:19:53 +01:00
}
return product;
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. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libfunc = optab_libfunc (binoptab, mode);
if (libfunc
1991-12-30 04:19:53 +01:00
&& (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN))
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
rtx op1x = op1;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode op1_mode = mode;
rtx value;
1991-12-30 04:19:53 +01:00
start_sequence ();
if (shift_optab_p (binoptab))
{
libgcc2.h (word_type): Type definition removed. 2007-07-06 Andreas Krebbel <krebbel1@de.ibm.com> * libgcc2.h (word_type): Type definition removed. (cmp_return_type, shift_count_type): Type definitions added. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * libgcc2.c (__udivmoddi4, __moddi3): Type of local variable c changed from word_type to Wtype. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. * targhooks.c (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Default implementations for the new target hooks added. * targhooks.h (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Function prototypes added. * target.h (struct gcc_target): Fields for the new target hooks added. * optabs.c (expand_binop): Use shift_count_mode when expanding shift as library call. (prepare_cmp_insn): Use cmp_return_mode when expanding comparison as library call. * doc/tm.texi (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Documentation added. * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target hooks defined. From-SVN: r126410
2007-07-06 12:47:31 +02:00
op1_mode = targetm.libgcc_shift_count_mode ();
/* Specify unsigned here,
since negative shift counts are meaningless. */
libgcc2.h (word_type): Type definition removed. 2007-07-06 Andreas Krebbel <krebbel1@de.ibm.com> * libgcc2.h (word_type): Type definition removed. (cmp_return_type, shift_count_type): Type definitions added. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * libgcc2.c (__udivmoddi4, __moddi3): Type of local variable c changed from word_type to Wtype. (__lshrdi3, __ashldi3, __ashrdi3): word_type of second parameter replaced with shift_count_type. (__cmpdi2, __ucmpdi2): word_type of return type replaced with cmp_return_type. * c-common.c (handle_mode_attribute): Handling for libgcc_cmp_return and libgcc_shift_count attribute added. * target-def.h (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): New target hooks defined. (TARGET_INITIALIZER): New target hooks added. * targhooks.c (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Default implementations for the new target hooks added. * targhooks.h (default_libgcc_cmp_return_mode, default_libgcc_shift_count_mode): Function prototypes added. * target.h (struct gcc_target): Fields for the new target hooks added. * optabs.c (expand_binop): Use shift_count_mode when expanding shift as library call. (prepare_cmp_insn): Use cmp_return_mode when expanding comparison as library call. * doc/tm.texi (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Documentation added. * config/s390/s390.c (s390_libgcc_cmp_return_mode, s390_libgcc_shift_count_mode): Functions added. (TARGET_LIBGCC_CMP_RETURN_MODE, TARGET_LIBGCC_SHIFT_COUNT_MODE): Target hooks defined. From-SVN: r126410
2007-07-06 12:47:31 +02:00
op1x = convert_to_mode (op1_mode, op1, 1);
}
if (GET_MODE (op0) != VOIDmode
&& GET_MODE (op0) != mode)
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. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
value = emit_library_call_value (libfunc,
NULL_RTX, LCT_CONST, mode, 2,
op0, mode, op1x, op1_mode);
1991-12-30 04:19:53 +01:00
insns = get_insns ();
end_sequence ();
target = gen_reg_rtx (mode);
emit_libcall_block_1 (insns, target, value,
gen_rtx_fmt_ee (optab_to_code (binoptab),
mode, op0, op1),
trapv_binoptab_p (binoptab));
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))
{
/* 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);
/* 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_HAS_WIDER_MODES_P (mclass))
1991-12-30 04:19:53 +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 (find_widening_optab_handler (binoptab, wider_mode, mode, 1)
!= CODE_FOR_nothing
1991-12-30 04:19:53 +01:00
|| (methods == OPTAB_LIB
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
&& optab_libfunc (binoptab, wider_mode)))
1991-12-30 04:19:53 +01:00
{
rtx xop0 = op0, xop1 = op1;
int no_extend = 0;
/* 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
the results to the same narrowness. */
1991-12-30 04:19:53 +01:00
if ((binoptab == ior_optab || binoptab == and_optab
|| binoptab == xor_optab
|| binoptab == add_optab || binoptab == sub_optab
|| binoptab == smul_optab || binoptab == ashl_optab)
&& mclass == MODE_INT)
1991-12-30 04:19:53 +01:00
no_extend = 1;
xop0 = widen_operand (xop0, wider_mode, mode,
unsignedp, no_extend);
/* The second operand of a shift must always be extended. */
xop1 = widen_operand (xop1, wider_mode, mode, unsignedp,
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)
{
if (mclass != MODE_INT
|| !TRULY_NOOP_TRUNCATION_MODES_P (mode, wider_mode))
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);
}
}
}
delete_insns_since (entry_last);
1991-12-30 04:19:53 +01:00
return 0;
}
/* 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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
sign_expand_binop (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
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx temp;
1991-12-30 04:19:53 +01:00
optab direct_optab = unsignedp ? uoptab : soptab;
bool save_enable;
1991-12-30 04:19:53 +01:00
/* 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. Disable any direct use of any
signed insn in the current mode. */
save_enable = swap_optab_enable (soptab, mode, false);
1991-12-30 04:19:53 +01:00
temp = expand_binop (mode, soptab, op0, op1, target,
1991-12-30 04:19:53 +01:00
unsignedp, OPTAB_WIDEN);
/* For unsigned operands, try widening to an unsigned int. */
if (!temp && unsignedp)
1991-12-30 04:19:53 +01:00
temp = expand_binop (mode, uoptab, op0, op1, target,
unsignedp, OPTAB_WIDEN);
if (temp || methods == OPTAB_WIDEN)
goto egress;
1991-12-30 04:19:53 +01:00
/* Use the right width libcall if that exists. */
temp = expand_binop (mode, direct_optab, op0, op1, target,
unsignedp, OPTAB_LIB);
1991-12-30 04:19:53 +01:00
if (temp || methods == OPTAB_LIB)
goto egress;
1991-12-30 04:19:53 +01:00
/* Must widen and use a libcall, use either signed or unsigned. */
temp = expand_binop (mode, soptab, op0, op1, target,
1991-12-30 04:19:53 +01:00
unsignedp, methods);
if (!temp && unsignedp)
temp = expand_binop (mode, uoptab, op0, op1, target,
1991-12-30 04:19:53 +01:00
unsignedp, methods);
egress:
/* Undo the fiddling above. */
if (save_enable)
swap_optab_enable (soptab, mode, true);
return temp;
1991-12-30 04:19:53 +01: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
expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
int unsignedp)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
enum mode_class mclass;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *entry_last = get_last_insn ();
rtx_insn *last;
mclass = GET_MODE_CLASS (mode);
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!targ0)
targ0 = gen_reg_rtx (mode);
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!targ1)
targ1 = gen_reg_rtx (mode);
/* Record where to go back to if we fail. */
last = get_last_insn ();
if (optab_handler (unoptab, mode) != CODE_FOR_nothing)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[3];
enum insn_code icode = optab_handler (unoptab, mode);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_fixed_operand (&ops[0], targ0);
create_fixed_operand (&ops[1], targ1);
create_convert_operand_from (&ops[2], op0, mode, unsignedp);
if (maybe_expand_insn (icode, 3, ops))
return 1;
}
/* It can't be done in this mode. Can we do it in a wider mode? */
if (CLASS_HAS_WIDER_MODES_P (mclass))
{
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
if (optab_handler (unoptab, wider_mode) != 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);
if (expand_twoval_unop (unoptab, cop0, t0, t1, unsignedp))
{
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
expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
int unsignedp)
1991-12-30 04:19:53 +01:00
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
enum mode_class mclass;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *entry_last = get_last_insn ();
rtx_insn *last;
1991-12-30 04:19:53 +01:00
mclass = GET_MODE_CLASS (mode);
1991-12-30 04:19:53 +01:00
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!targ0)
1991-12-30 04:19:53 +01:00
targ0 = gen_reg_rtx (mode);
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!targ1)
1991-12-30 04:19:53 +01:00
targ1 = gen_reg_rtx (mode);
/* Record where to go back to if we fail. */
last = get_last_insn ();
if (optab_handler (binoptab, mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[4];
enum insn_code icode = optab_handler (binoptab, mode);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode0 = insn_data[icode].operand[1].mode;
machine_mode mode1 = insn_data[icode].operand[2].mode;
1991-12-30 04:19:53 +01:00
rtx xop0 = op0, xop1 = op1;
/* If we are optimizing, force expensive constants into a register. */
tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. gcc/ * doc/tm.texi.in (TARGET_RTX_COSTS): Add an opno paramter. * doc/tm.texi: Regenerate. * target.def (rtx_costs): Add an opno parameter. * hooks.h (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * hooks.c (hook_bool_rtx_int_int_intp_bool_false): Replace with... (hook_bool_rtx_int_int_int_intp_bool_false): ...this. * cse.c (COST_IN): Add an opno parameter. (notreg_cost): Likewise. Update call to rtx_cost. (COST, fold_rtx): Update accordingly. * dojump.c (prefer_and_bit_test): Update call to rtx_cost. * expmed.c (emit_store_flag): Likewise. * optabs.c (avoid_expensive_constant): Add an opno parameter. Update call to rtx_cost. (expand_binop_directly, expand_binop): Likewise. (expand_twoval_binop, prepare_cmp_insn): Likewise. * rtl.h (rtx_cost, get_full_rtx_cost): Add opno parameters. (set_src_cost, get_full_set_src_cost): Update accordingly. * rtlanal.c (rtx_cost): Add an opno parameter. Update call to target hook. (get_full_rtx_cost): Add an opno paramter. Update calls to rtx_cost. (default_adress_cost): Update calls to rtx_cost. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs) (arm_slowmul_rtx_costs): Adjust calls to rtx_cost. (arm_rtx_costs): Add an opno parameter. * config/alpha/alpha.c (alpha_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/avr/avr.c (avr_operand_rtx_cost, avr_rtx_costs): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_binary_cost): Update call to rtx_cost. (mips_zero_extend_cost): Add an opno parameter. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_address_cost): Update call to rtx_cost. (mn10300_rtx_costs): Add an opno parameter and adjust any recursive rtx-cost calls. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/picochip/picochip.c (picochip_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. (rs6000_debug_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/score/score-protos.h (score_rtx_costs): Likewise. * config/score/score.c (score_rtx_costs): Likewise. * config/sh/sh.c (andcosts): Update call to rtx_cost. (sh_rtx_costs): Add an opno parameter. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. From-SVN: r177852
2011-08-18 14:37:53 +02:00
xop0 = avoid_expensive_constant (mode0, binoptab, 0, xop0, unsignedp);
xop1 = avoid_expensive_constant (mode1, binoptab, 1, xop1, unsignedp);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_fixed_operand (&ops[0], targ0);
create_convert_operand_from (&ops[1], op0, mode, unsignedp);
create_convert_operand_from (&ops[2], op1, mode, unsignedp);
create_fixed_operand (&ops[3], targ1);
if (maybe_expand_insn (icode, 4, ops))
return 1;
delete_insns_since (last);
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_HAS_WIDER_MODES_P (mclass))
1991-12-30 04:19:53 +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 (optab_handler (binoptab, wider_mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx t0 = gen_reg_rtx (wider_mode);
rtx t1 = gen_reg_rtx (wider_mode);
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
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);
}
}
}
delete_insns_since (entry_last);
1991-12-30 04:19:53 +01:00
return 0;
}
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
/* Expand the two-valued library call indicated by BINOPTAB, but
preserve only one of the values. If TARG0 is non-NULL, the first
value is placed into TARG0; otherwise the second value is placed
into TARG1. Exactly one of TARG0 and TARG1 must be non-NULL. The
value stored into TARG0 or TARG1 is equivalent to (CODE OP0 OP1).
This routine assumes that the value returned by the library call is
as if the return value was of an integral mode twice as wide as the
mode of OP0. Returns 1 if the call was successful. */
bool
expand_twoval_binop_libfunc (optab binoptab, rtx op0, rtx op1,
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
rtx targ0, rtx targ1, enum rtx_code code)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
machine_mode libval_mode;
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
rtx libval;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx libfunc;
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
/* Exactly one of TARG0 or TARG1 should be non-NULL. */
gcc_assert (!targ0 != !targ1);
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
mode = GET_MODE (op0);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libfunc = optab_libfunc (binoptab, mode);
if (!libfunc)
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
return false;
/* The value returned by the library function will have twice as
many bits as the nominal MODE. */
libval_mode = smallest_mode_for_size (2 * GET_MODE_BITSIZE (mode),
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
MODE_INT);
start_sequence ();
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libval = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
libval_mode, 2,
op0, mode,
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
op1, mode);
/* Get the part of VAL containing the value that we want. */
libval = simplify_gen_subreg (mode, libval, libval_mode,
targ0 ? 0 : GET_MODE_SIZE (mode));
insns = get_insns ();
end_sequence ();
/* Move the into the desired location. */
emit_libcall_block (insns, targ0 ? targ0 : targ1, libval,
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
gen_rtx_fmt_ee (code, mode, op0, op1));
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
return true;
}
1991-12-30 04:19:53 +01: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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_simple_unop (machine_mode mode, enum rtx_code code, rtx op0,
rtx target, int unsignedp)
{
optab unop = code_to_optab (code);
gcc_assert (unop);
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
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
2011-06-21 16:16:39 +02:00
(clz:wide (zero_extend:wide x)) - ((width wide) - (width narrow)).
A similar operation can be used for clrsb. UNOPTAB says which operation
we are trying to expand. */
[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
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
widen_leading (machine_mode mode, rtx op0, rtx target, optab unoptab)
[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 mclass = GET_MODE_CLASS (mode);
if (CLASS_HAS_WIDER_MODES_P (mclass))
[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
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
[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
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
2011-06-21 16:16:39 +02:00
if (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing)
[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
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx xop0, temp;
rtx_insn *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
last = get_last_insn ();
if (target == 0)
target = gen_reg_rtx (mode);
xop0 = widen_operand (op0, wider_mode, mode,
unoptab != clrsb_optab, false);
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
unoptab != clrsb_optab);
[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
if (temp != 0)
temp = expand_binop
(wider_mode, sub_optab, temp,
gen_int_mode (GET_MODE_PRECISION (wider_mode)
- GET_MODE_PRECISION (mode),
wider_mode),
target, true, OPTAB_DIRECT);
[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
if (temp == 0)
delete_insns_since (last);
return temp;
}
}
}
return 0;
}
/* Try calculating clz of a double-word quantity as two clz's of word-sized
quantities, choosing which based on whether the high word is nonzero. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_doubleword_clz (machine_mode mode, rtx op0, rtx target)
{
rtx xop0 = force_reg (mode, op0);
rtx subhi = gen_highpart (word_mode, xop0);
rtx sublo = gen_lowpart (word_mode, xop0);
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_code_label *hi0_label = gen_label_rtx ();
rtx_code_label *after_label = gen_label_rtx ();
rtx_insn *seq;
rtx temp, result;
/* If we were not given a target, use a word_mode register, not a
'mode' register. The result will fit, and nobody is expecting
anything bigger (the return type of __builtin_clz* is int). */
if (!target)
target = gen_reg_rtx (word_mode);
/* In any case, write to a word_mode scratch in both branches of the
conditional, so we can ensure there is a single move insn setting
'target' to tag a REG_EQUAL note on. */
result = gen_reg_rtx (word_mode);
start_sequence ();
/* If the high word is not equal to zero,
then clz of the full value is clz of the high word. */
emit_cmp_and_jump_insns (subhi, CONST0_RTX (word_mode), EQ, 0,
word_mode, true, hi0_label);
temp = expand_unop_direct (word_mode, clz_optab, subhi, result, true);
if (!temp)
goto fail;
if (temp != result)
convert_move (result, temp, true);
emit_jump_insn (targetm.gen_jump (after_label));
emit_barrier ();
/* Else clz of the full value is clz of the low word plus the number
of bits in the high word. */
emit_label (hi0_label);
temp = expand_unop_direct (word_mode, clz_optab, sublo, 0, true);
if (!temp)
goto fail;
temp = expand_binop (word_mode, add_optab, temp,
gen_int_mode (GET_MODE_BITSIZE (word_mode), word_mode),
result, true, OPTAB_DIRECT);
if (!temp)
goto fail;
if (temp != result)
convert_move (result, temp, true);
emit_label (after_label);
convert_move (target, result, true);
seq = get_insns ();
end_sequence ();
add_equal_note (seq, target, CLZ, xop0, 0);
emit_insn (seq);
return target;
fail:
end_sequence ();
return 0;
}
/* Try calculating
(bswap:narrow x)
as
(lshiftrt:wide (bswap:wide x) ((width wide) - (width narrow))). */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
widen_bswap (machine_mode mode, rtx op0, rtx target)
{
enum mode_class mclass = GET_MODE_CLASS (mode);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx x;
rtx_insn *last;
if (!CLASS_HAS_WIDER_MODES_P (mclass))
return NULL_RTX;
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
if (optab_handler (bswap_optab, wider_mode) != CODE_FOR_nothing)
goto found;
return NULL_RTX;
found:
last = get_last_insn ();
x = widen_operand (op0, wider_mode, mode, true, true);
x = expand_unop (wider_mode, bswap_optab, x, NULL_RTX, true);
gcc_assert (GET_MODE_PRECISION (wider_mode) == GET_MODE_BITSIZE (wider_mode)
&& GET_MODE_PRECISION (mode) == GET_MODE_BITSIZE (mode));
if (x != 0)
x = expand_shift (RSHIFT_EXPR, wider_mode, x,
GET_MODE_BITSIZE (wider_mode)
- GET_MODE_BITSIZE (mode),
NULL_RTX, true);
if (x != 0)
{
if (target == 0)
target = gen_reg_rtx (mode);
emit_move_insn (target, gen_lowpart (mode, x));
}
else
delete_insns_since (last);
return target;
}
/* Try calculating bswap as two bswaps of two word-sized operands. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_doubleword_bswap (machine_mode mode, rtx op, rtx target)
{
rtx t0, t1;
t1 = expand_unop (word_mode, bswap_optab,
operand_subword_force (op, 0, mode), NULL_RTX, true);
t0 = expand_unop (word_mode, bswap_optab,
operand_subword_force (op, 1, mode), NULL_RTX, true);
if (target == 0 || !valid_multiword_target_p (target))
target = gen_reg_rtx (mode);
if (REG_P (target))
rtl.h (emit_clobber, [...]): Declare. gcc/ * rtl.h (emit_clobber, gen_clobber, emit_use, gen_use): Declare. * emit-rtl.c (emit_clobber, gen_clobber, emit_use, gen_use): New functions. Do not emit uses and clobbers of CONCATs; individually use and clobber their operands. * builtins.c (expand_builtin_setjmp_receiver): Use emit_clobber, gen_clobber, emit_use and gen_use. (expand_builtin_longjmp, expand_builtin_nonlocal_goto): Likewise. (expand_builtin_return): Likewise. * cfgbuild.c (count_basic_blocks): Likewise. * cfgrtl.c (rtl_flow_call_edges_add): Likewise. * explow.c (emit_stack_restore): Likewise. * expmed.c (extract_bit_field_1): Likewise. * expr.c (convert_move, emit_move_complex_parts): Likewise. (emit_move_multi_word, store_constructor): Likewise. * function.c (do_clobber_return_reg, do_use_return_reg): Likewise. (thread_prologue_and_epilogue_insns): Likewise. * lower-subreg.c (resolve_simple_move): Likewise. * optabs.c (widen_operand, expand_binop): Likewise. (expand_doubleword_bswap, emit_no_conflict_block): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (eliminate_regs_in_insn): Likewise. * stmt.c (expand_nl_goto_receiver): Likewise. * config/alpha/alpha.md (builtin_longjmp): Likewise. * config/arc/arc.md (*movdi_insn, *movdf_insn): Likewise. * config/arm/arm.c (arm_load_pic_register): Likewise. (thumb1_expand_epilogue, thumb_set_return_address): Likewise. * config/arm/arm.md (untyped_return): Likewise. * config/arm/linux-elf.h (PROFILE_HOOK): Likewise. * config/avr/avr.c (expand_prologue): Likewise. * config/bfin/bfin.c (do_unlink): Likewise. * config/bfin/bfin.md (<optab>di3, adddi3, subdi3): Likewise. * config/cris/cris.c (cris_expand_prologue): Likewise. * config/darwin.c (machopic_indirect_data_reference): Likewise. (machopic_legitimize_pic_address): Likewise. * config/frv/frv.c (frv_frame_access, frv_expand_epilogue): Likewise. (frv_ifcvt_modify_insn, frv_expand_mdpackh_builtin): Likewise. * config/i386/i386.c (ix86_expand_vector_move_misalign): Likewise. (ix86_expand_convert_uns_didf_sse): Likewise. (ix86_expand_vector_init_general): Likewise. * config/ia64/ia64.md (eh_epilogue): Likewise. * config/iq2000/iq2000.c (iq2000_expand_epilogue): Likewise. * config/m32c/m32c.c (m32c_emit_eh_epilogue): Likewise. * config/m32r/m32r.c (m32r_reload_lr): Likewise. (config/iq2000/iq2000.c): Likewise. * config/mips/mips.md (fixuns_truncdfsi2): Likewise. (fixuns_truncdfdi2, fixuns_truncsfsi2, fixuns_truncsfdi2): Likewise. (builtin_longjmp): Likewise. * config/mn10300/mn10300.md (call, call_value): Likewise. * config/pa/pa.md (nonlocal_goto, nonlocal_longjmp): Likewise. * config/pdp11/pdp11.md (abshi2): Likewise. * config/rs6000/rs6000.c (rs6000_emit_move): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * config/s390/s390.md (movmem_long, setmem_long): Likewise. (cmpmem_long, extendsidi2, zero_extendsidi2, udivmoddi4): Likewise. (builtin_setjmp_receiver, restore_stack_nonlocal): Likewise. * config/sh/sh.c (prepare_move_operands): Likewise. (output_stack_adjust, sh_expand_epilogue): Likewise. (sh_set_return_address, sh_expand_t_scc): Likewise. * config/sparc/sparc.c (load_pic_register): Likewise. * config/sparc/sparc.md (untyped_return, nonlocal_goto): Likewise. * config/spu/spu.c (spu_expand_epilogue): Likewise. * config/v850/v850.c (expand_epilogue): Likewise. From-SVN: r136251
2008-06-01 11:47:28 +02:00
emit_clobber (target);
emit_move_insn (operand_subword (target, 0, 1, mode), t0);
emit_move_insn (operand_subword (target, 1, 1, mode), t1);
return 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
/* Try calculating (parity x) as (and (popcount x) 1), where
popcount can also be done in a wider mode. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_parity (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 mclass = GET_MODE_CLASS (mode);
if (CLASS_HAS_WIDER_MODES_P (mclass))
[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
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode 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
for (wider_mode = mode; wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
if (optab_handler (popcount_optab, wider_mode) != CODE_FOR_nothing)
[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
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx xop0, temp;
rtx_insn *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
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)
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;
}
/* Try calculating ctz(x) as K - clz(x & -x) ,
where K is GET_MODE_PRECISION(mode) - 1.
Both __builtin_ctz and __builtin_clz are undefined at zero, so we
don't have to worry about what the hardware does in that case. (If
the clz instruction produces the usual value at 0, which is K, the
result of this code sequence will be -1; expand_ffs, below, relies
on this. It might be nice to have it be K instead, for consistency
with the (very few) processors that provide a ctz with a defined
value, but that would take one more instruction, and it would be
less convenient for expand_ffs anyway. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_ctz (machine_mode mode, rtx op0, rtx target)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *seq;
rtx temp;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
if (optab_handler (clz_optab, mode) == CODE_FOR_nothing)
return 0;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
start_sequence ();
temp = expand_unop_direct (mode, neg_optab, op0, NULL_RTX, true);
if (temp)
temp = expand_binop (mode, and_optab, op0, temp, NULL_RTX,
true, OPTAB_DIRECT);
if (temp)
temp = expand_unop_direct (mode, clz_optab, temp, NULL_RTX, true);
if (temp)
temp = expand_binop (mode, sub_optab,
gen_int_mode (GET_MODE_PRECISION (mode) - 1, mode),
temp, target,
true, OPTAB_DIRECT);
if (temp == 0)
{
end_sequence ();
return 0;
}
seq = get_insns ();
end_sequence ();
add_equal_note (seq, temp, CTZ, op0, 0);
emit_insn (seq);
return temp;
}
/* Try calculating ffs(x) using ctz(x) if we have that instruction, or
else with the sequence used by expand_clz.
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
The ffs builtin promises to return zero for a zero value and ctz/clz
may have an undefined value in that case. If they do not give us a
convenient value, we have to generate a test and branch. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_ffs (machine_mode mode, rtx op0, rtx target)
{
HOST_WIDE_INT val = 0;
bool defined_at_zero = false;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx temp;
rtx_insn *seq;
if (optab_handler (ctz_optab, mode) != CODE_FOR_nothing)
{
start_sequence ();
temp = expand_unop_direct (mode, ctz_optab, op0, 0, true);
if (!temp)
goto fail;
defined_at_zero = (CTZ_DEFINED_VALUE_AT_ZERO (mode, val) == 2);
}
else if (optab_handler (clz_optab, mode) != CODE_FOR_nothing)
{
start_sequence ();
temp = expand_ctz (mode, op0, 0);
if (!temp)
goto fail;
if (CLZ_DEFINED_VALUE_AT_ZERO (mode, val) == 2)
{
defined_at_zero = true;
val = (GET_MODE_PRECISION (mode) - 1) - val;
}
}
else
return 0;
if (defined_at_zero && val == -1)
/* No correction needed at zero. */;
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
else
{
/* We don't try to do anything clever with the situation found
on some processors (eg Alpha) where ctz(0:mode) ==
bitsize(mode). If someone can think of a way to send N to -1
and leave alone all values in the range 0..N-1 (where N is a
power of two), cheaper than this test-and-branch, please add it.
The test-and-branch is done after the operation itself, in case
the operation sets condition codes that can be recycled for this.
(This is true on i386, for instance.) */
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_code_label *nonzero_label = gen_label_rtx ();
emit_cmp_and_jump_insns (op0, CONST0_RTX (mode), NE, 0,
mode, true, nonzero_label);
convert_move (temp, GEN_INT (-1), false);
emit_label (nonzero_label);
}
/* temp now has a value in the range -1..bitsize-1. ffs is supposed
to produce a value in the range 0..bitsize. */
temp = expand_binop (mode, add_optab, temp, gen_int_mode (1, mode),
target, false, OPTAB_DIRECT);
if (!temp)
goto fail;
seq = get_insns ();
end_sequence ();
add_equal_note (seq, temp, FFS, op0, 0);
emit_insn (seq);
return temp;
fail:
end_sequence ();
return 0;
}
/* Extract the OMODE lowpart from VAL, which has IMODE. Under certain
conditions, VAL may already be a SUBREG against which we cannot generate
a further SUBREG. In this case, we expect forcing the value into a
register will work around the situation. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
lowpart_subreg_maybe_copy (machine_mode omode, rtx val,
machine_mode imode)
{
rtx ret;
ret = lowpart_subreg (omode, val, imode);
if (ret == NULL)
{
val = force_reg (imode, val);
ret = lowpart_subreg (omode, val, imode);
gcc_assert (ret != NULL);
}
return ret;
}
/* Expand a floating point absolute value or negation operation via a
logical operation on the sign bit. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_absneg_bit (enum rtx_code code, machine_mode mode,
rtx op0, rtx target)
{
const struct real_format *fmt;
int bitpos, word, nwords, i;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode imode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx temp;
rtx_insn *insns;
/* The format has to have a simple sign bit. */
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL)
return NULL_RTX;
bitpos = fmt->signbit_rw;
if (bitpos < 0)
return NULL_RTX;
/* Don't create negative zeros if the format doesn't support them. */
if (code == NEG && !fmt->has_signed_zero)
return NULL_RTX;
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
{
imode = int_mode_for_mode (mode);
if (imode == BLKmode)
return NULL_RTX;
word = 0;
nwords = 1;
}
else
{
imode = word_mode;
if (FLOAT_WORDS_BIG_ENDIAN)
word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
else
word = bitpos / BITS_PER_WORD;
bitpos = bitpos % BITS_PER_WORD;
nwords = (GET_MODE_BITSIZE (mode) + BITS_PER_WORD - 1) / BITS_PER_WORD;
}
2014-05-06 18:25:05 +02:00
wide_int mask = wi::set_bit_in_zero (bitpos, GET_MODE_PRECISION (imode));
if (code == ABS)
Modify gcc/*.[hc] double_int call sites to use the new interface. This change entailed adding a few new methods to double_int. The change results in a 0.163% time improvement with a 70% confidence. Tested on x86_64. Index: gcc/ChangeLog 2012-09-06 Lawrence Crowl <crowl@google.com> * double-int.h (double_int::operator &=): New. (double_int::operator ^=): New. (double_int::operator |=): New. (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. (binary double_int::operator *): Remove parameter name. (binary double_int::operator +): Likewise. (binary double_int::operator -): Likewise. (binary double_int::operator &): Likewise. (double_int::operator |): Likewise. (double_int::operator ^): Likewise. (double_int::and_not): Likewise. (double_int::from_shwi): Tidy formatting. (double_int::from_uhwi): Likewise. (double_int::from_uhwi): Likewise. * double-int.c (double_int::mul_with_sign): Modify overflow parameter to bool*. (double_int::add_with_sign): New. (double_int::ule): New. (double_int::sle): New. * builtins.c: Modify to use the new double_int interface. * cgraph.c: Likewise. * combine.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * fixed-value.c: Likewise. * fold-const.c: Likewise. * gimple-fold.c: Likewise. * gimple-ssa-strength-reduction.c: Likewise. * gimplify-rtx.c: Likewise. * ipa-prop.c: Likewise. * loop-iv.c: Likewise. * optabs.c: Likewise. * stor-layout.c: Likewise. * tree-affine.c: Likewise. * tree-cfg.c: Likewise. * tree-dfa.c: Likewise. * tree-flow-inline.h: Likewise. * tree-object-size.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-sccvn: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vrp.c: Likewise. * tree.h: Likewise. * tree.c: Likewise. * varasm.c: Likewise. From-SVN: r191047
2012-09-07 02:06:35 +02:00
mask = ~mask;
if (target == 0
|| target == op0
|| (nwords > 1 && !valid_multiword_target_p (target)))
target = gen_reg_rtx (mode);
if (nwords > 1)
{
start_sequence ();
for (i = 0; i < nwords; ++i)
{
rtx targ_piece = operand_subword (target, i, 1, mode);
rtx op0_piece = operand_subword_force (op0, i, mode);
if (i == word)
{
temp = expand_binop (imode, code == ABS ? and_optab : xor_optab,
op0_piece,
2014-05-06 18:25:05 +02:00
immed_wide_int_const (mask, imode),
targ_piece, 1, OPTAB_LIB_WIDEN);
if (temp != targ_piece)
emit_move_insn (targ_piece, temp);
}
else
emit_move_insn (targ_piece, op0_piece);
}
insns = get_insns ();
end_sequence ();
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
emit_insn (insns);
}
else
{
temp = expand_binop (imode, code == ABS ? and_optab : xor_optab,
gen_lowpart (imode, op0),
2014-05-06 18:25:05 +02:00
immed_wide_int_const (mask, imode),
gen_lowpart (imode, target), 1, OPTAB_LIB_WIDEN);
target = lowpart_subreg_maybe_copy (mode, temp, imode);
set_dst_reg_note (get_last_insn (), REG_EQUAL,
gen_rtx_fmt_e (code, mode, copy_rtx (op0)),
target);
}
return target;
}
/* As expand_unop, but will fail rather than attempt the operation in a
different mode or with a libcall. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_unop_direct (machine_mode mode, optab unoptab, rtx op0, rtx target,
int unsignedp)
1991-12-30 04:19:53 +01:00
{
if (optab_handler (unoptab, mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[2];
enum insn_code icode = optab_handler (unoptab, mode);
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
rtx_insn *pat;
1991-12-30 04:19:53 +01:00
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, mode);
create_convert_operand_from (&ops[1], op0, mode, unsignedp);
pat = maybe_gen_insn (icode, 2, ops);
1991-12-30 04:19:53 +01:00
if (pat)
{
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& ! add_equal_note (pat, ops[0].value,
Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ 2014-08-28 David Malcolm <dmalcolm@redhat.com> * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise for local "insn". (define_expand "umulsi3_highpart"): Likewise for local "insn". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_insn): Likewise. (prev_nonnote_nondebug_insn): Likewise. (next_real_insn): Likewise. (prev_real_insn): Likewise. (next_active_insn): Likewise. (prev_active_insn): Likewise. (next_cc0_user): Likewise. Use rtx_sequence and a method for clarity. (prev_cc0_setter): Likewise. (try_split): Rename param "trial" to "uncast_trial" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping checked casts made redundant by this change. Strengthen locals "seq", "tem", "insn_last", "insn", "next" from rtx to rtx_insn *. (remove_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. (emit_pattern_after_setloc): Likewise for param "after", as "uncast_after". (emit_pattern_after): Likewise. Strengthen local "prev" from rtx to rtx_insn *. (emit_pattern_before_setloc): Rename param "before" to "uncast_before" and reintroduce "before" as a local rtx_insn * using a checked cast. Strengthen locals "first", "last" from rtx to rtx_insn *. (emit_pattern_before): Likewise rename/cast param "before" to "uncast_before". Strengthen local "next" from rtx to rtx_insn *. * except.c (copy_reg_eh_region_note_forward): Strengthen param "first" and local "insn" from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise for param "last" and local "insn". * expr.c (fixup_args_size_notes): Rename param "last" to "uncast_last" and reintroduce "last" as a local rtx_insn * using a checked cast. Strengthen local "insn" from rtx to rtx_insn *. * function.c (set_insn_locations): Strengthen param "insn" from rtx to rtx_insn *. (record_insns): Likewise for param "insns" and local "tmp". (active_insn_between): Rename param "tail" to "uncast_tail" and reintroduce "tail" as a local rtx_insn * using a checked cast. (thread_prologue_and_epilogue_insns): Split out top-level local rtx "seq" into three different rtx_insn * locals. Strengthen local "prologue_seq" from rtx to rtx_insn *. * gcse.c (insert_insn_end_basic_block): Strenghen local "insn" from rtx to rtx_insn *. * haifa-sched.c (initiate_bb_reg_pressure_info): Likewise. (priority): Likewise for locals "prev_first", "twin". (setup_insn_max_reg_pressure): Likewise for param "after". (sched_setup_bb_reg_pressure_info): Likewise. (no_real_insns_p): Strengthen params from const_rtx to const rtx_insn *. (schedule_block): Strengthen local "next_tail" from rtx to rtx_insn *. * ifcvt.c (find_active_insn_before): Strengthen return type and param "insn" from rtx to rtx_insn *. (find_active_insn_after): Likewise. (cond_exec_process_insns): Likewise for param "start" and local "insn". (cond_exec_process_if_block): Likewise for locals "then_start", "then_end", "else_start", "else_end", "insn", "start", "end", "from". (noce_process_if_block): Likewise for local "jump". (merge_if_block): Likewise for two locals named "end". (cond_exec_find_if_block): Likewise for local "last_insn". * jump.c (delete_related_insns): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. Strengthen local "p" from rtx to rtx_insn *. * lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with NULL. (split_reg): Likewise. * lra.c (lra_process_new_insns): Likewise. * modulo-sched.c (permute_partial_schedule): Strengthen param "last" from rtx to rtx_insn *. * optabs.c (add_equal_note): Likewise for param "insns" and local "last_insn". (expand_binop_directly): Add checked casts to rtx_insn * within NEXT_INSN (pat) uses. (expand_unop_direct): Likewise. (maybe_emit_unop_insn): Likewise. * recog.c (peep2_attempt): Strengthen locals "last", "before_try", "x" from rtx to rtx_insn *. * reorg.c (optimize_skip): Strengthen return type and local "delay_list" from rtx to rtx_insn_list *. Strengthen param "insn" and locals "trial", "next_trial" from rtx to rtx_insn *. * resource.c (next_insn_no_annul): Strengthen return type and param "insn" from rtx to rtx_insn *. Use a cast to and method of rtx_sequence to clarify the code. (mark_referenced_resources): Add a checked cast to rtx_insn * within PREV_INSN (x). (find_dead_or_set_registers): Strengthen return type, param "target", locals "insn", "next", "jump_insn", "this_jump_insn" from rtx to rtx_insn *. Strengthen param "jump_target" from rtx * to rtx_insn **. (mark_target_live_regs): Strengthen params "insns" and "target", locals "insn", "jump_target", "start_insn", "stop_insn" from rtx to rtx_insn *. Use cast to and method of rtx_sequence to clarify the code. * resource.h (mark_target_live_regs): Strengthen params 1 and 2 from rtx to rtx_insn *. * rtl.h (copy_reg_eh_region_note_forward): Strengthen second param from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise. (unshare_all_rtl_in_chain): Likewise for sole param. (dump_rtl_slim): Strengthen second and third params from const_rtx to const rtx_insn *. * sched-deps.c (sched_free_deps): Strengthen params "head" and "tail" and locals "insn", "next_tail" from rtx to rtx_insn *. * sched-ebb.c (init_ready_list): Strengthen locals "prev_head", "next_tail" from rtx to rtx_insn *. (begin_move_insn): Likewise for local "next". * sched-int.h (sched_free_deps): Likewise for first and second params. (no_real_insns_p): Strengthen both params from const_rtx to const rtx_insn *. (sched_setup_bb_reg_pressure_info): Strengthen second params from rtx to rtx_insn *. * sched-rgn.c (init_ready_list): Likewise for locals "prev_head", "next_tail". * sched-vis.c (dump_rtl_slim): Strengthen params "first", "last" and locals "insn", "tail" from const_rtx to const rtx_insn *. (rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to rtx_insn *. (debug_rtl_slim): Strengthen params "first" and "last" from const_rtx to const rtx_insn *. * shrink-wrap.c (try_shrink_wrapping): Strengthen param "prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *. (convert_to_simple_return): Likewise for param "returnjump". * shrink-wrap.h (try_shrink_wrapping): Likewise for param "prologue_seq". (convert_to_simple_return): Likewise for param "returnjump". * valtrack.c (propagate_for_debug): Likewise for params "insn", "last". * valtrack.h (propagate_for_debug): Likewise for second param. From-SVN: r214693
2014-08-28 22:45:40 +02:00
optab_to_code (unoptab),
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
ops[1].value, 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);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
return ops[0].value;
1991-12-30 04:19:53 +01:00
}
}
return 0;
}
/* 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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_unop (machine_mode mode, optab unoptab, rtx op0, rtx target,
int unsignedp)
{
enum mode_class mclass = GET_MODE_CLASS (mode);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wider_mode;
rtx temp;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx libfunc;
temp = expand_unop_direct (mode, unoptab, op0, target, unsignedp);
if (temp)
return temp;
1991-12-30 04:19:53 +01:00
/* It can't be done in this mode. Can we open-code it in a wider mode? */
/* Widening (or narrowing) clz needs special treatment. */
[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
if (unoptab == clz_optab)
{
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
2011-06-21 16:16:39 +02:00
temp = widen_leading (mode, op0, target, unoptab);
[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
if (temp)
return temp;
if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
&& optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
{
temp = expand_doubleword_clz (mode, op0, target);
if (temp)
return temp;
}
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
2011-06-21 16:16:39 +02:00
goto try_libcall;
}
if (unoptab == clrsb_optab)
{
temp = widen_leading (mode, op0, target, unoptab);
if (temp)
return temp;
goto try_libcall;
[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 (or narrowing) bswap needs special treatment. */
extend.texi (__builtin_bswap32): Document. 2006-09-07 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. Co-Authored-By: Falk Hueffner <falk@debian.org> From-SVN: r118361
2006-11-01 06:14:40 +01:00
if (unoptab == bswap_optab)
{
/* HImode is special because in this mode BSWAP is equivalent to ROTATE
or ROTATERT. First try these directly; if this fails, then try the
obvious pair of shifts with allowed widening, as this will probably
be always more efficient than the other fallback methods. */
if (mode == HImode)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last;
rtx temp1, temp2;
if (optab_handler (rotl_optab, mode) != CODE_FOR_nothing)
{
temp = expand_binop (mode, rotl_optab, op0, GEN_INT (8), target,
unsignedp, OPTAB_DIRECT);
if (temp)
return temp;
}
if (optab_handler (rotr_optab, mode) != CODE_FOR_nothing)
{
temp = expand_binop (mode, rotr_optab, op0, GEN_INT (8), target,
unsignedp, OPTAB_DIRECT);
if (temp)
return temp;
}
last = get_last_insn ();
temp1 = expand_binop (mode, ashl_optab, op0, GEN_INT (8), NULL_RTX,
unsignedp, OPTAB_WIDEN);
temp2 = expand_binop (mode, lshr_optab, op0, GEN_INT (8), NULL_RTX,
unsignedp, OPTAB_WIDEN);
if (temp1 && temp2)
{
temp = expand_binop (mode, ior_optab, temp1, temp2, target,
unsignedp, OPTAB_WIDEN);
if (temp)
return temp;
}
delete_insns_since (last);
}
temp = widen_bswap (mode, op0, target);
if (temp)
return temp;
if (GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
&& optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
{
temp = expand_doubleword_bswap (mode, op0, target);
if (temp)
return temp;
}
goto try_libcall;
}
extend.texi (__builtin_bswap32): Document. 2006-09-07 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. Co-Authored-By: Falk Hueffner <falk@debian.org> From-SVN: r118361
2006-11-01 06:14:40 +01:00
if (CLASS_HAS_WIDER_MODES_P (mclass))
for (wider_mode = GET_MODE_WIDER_MODE (mode);
wider_mode != VOIDmode;
wider_mode = GET_MODE_WIDER_MODE (wider_mode))
{
if (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing)
{
rtx xop0 = op0;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
/* For certain operations, we need not actually extend
the narrow operand, as long as we will truncate the
results to the same narrowness. */
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
(unoptab == neg_optab
|| unoptab == one_cmpl_optab)
&& mclass == MODE_INT);
1992-07-06 22:04:10 +02:00
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
unsignedp);
if (temp)
{
if (mclass != MODE_INT
|| !TRULY_NOOP_TRUNCATION_MODES_P (mode, wider_mode))
{
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
&& mclass == MODE_INT
1991-12-30 04:19:53 +01:00
&& GET_MODE_SIZE (mode) > UNITS_PER_WORD
&& optab_handler (unoptab, word_mode) != CODE_FOR_nothing)
1991-12-30 04:19:53 +01:00
{
int i;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
1991-12-30 04:19:53 +01:00
if (target == 0 || target == op0 || !valid_multiword_target_p (target))
1991-12-30 04:19:53 +01:00
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);
rtx x = expand_unop (word_mode, unoptab,
1991-12-30 04:19:53 +01:00
operand_subword_force (op0, i, mode),
target_piece, unsignedp);
1991-12-30 04:19:53 +01:00
if (target_piece != x)
emit_move_insn (target_piece, x);
}
insns = get_insns ();
end_sequence ();
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
emit_insn (insns);
1991-12-30 04:19:53 +01:00
return target;
}
if (optab_to_code (unoptab) == NEG)
{
/* Try negating floating point values by flipping the sign bit. */
if (SCALAR_FLOAT_MODE_P (mode))
{
temp = expand_absneg_bit (NEG, mode, op0, target);
if (temp)
return temp;
}
/* If there is no negation pattern, and we have no negative zero,
try subtracting from zero. */
if (!HONOR_SIGNED_ZEROS (mode))
{
temp = expand_binop (mode, (unoptab == negv_optab
? subv_optab : 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 calculating parity (x) as popcount (x) % 2. */
if (unoptab == parity_optab)
{
temp = expand_parity (mode, op0, target);
if (temp)
return temp;
}
/* Try implementing ffs (x) in terms of clz (x). */
if (unoptab == ffs_optab)
{
temp = expand_ffs (mode, op0, target);
if (temp)
return temp;
}
/* Try implementing ctz (x) in terms of clz (x). */
if (unoptab == ctz_optab)
{
temp = expand_ctz (mode, op0, target);
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:
/* Now try a library call in this mode. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libfunc = optab_libfunc (unoptab, mode);
if (libfunc)
1991-12-30 04:19:53 +01:00
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
rtx value;
rtx eq_value;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode outmode = 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
/* 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
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
2011-06-21 16:16:39 +02:00
|| unoptab == clrsb_optab || unoptab == popcount_optab
|| unoptab == parity_optab)
outmode
= GET_MODE (hard_libcall_value (TYPE_MODE (integer_type_node),
optab_libfunc (unoptab, mode)));
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. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, outmode,
[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
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);
eq_value = gen_rtx_fmt_e (optab_to_code (unoptab), mode, op0);
if (GET_MODE_SIZE (outmode) < GET_MODE_SIZE (mode))
eq_value = simplify_gen_unary (TRUNCATE, outmode, eq_value, mode);
else if (GET_MODE_SIZE (outmode) > GET_MODE_SIZE (mode))
eq_value = simplify_gen_unary (ZERO_EXTEND, outmode, eq_value, mode);
emit_libcall_block_1 (insns, target, value, eq_value,
trapv_unoptab_p (unoptab));
1991-12-30 04:19:53 +01:00
return target;
}
/* It can't be done in this mode. Can we do it in a wider mode? */
if (CLASS_HAS_WIDER_MODES_P (mclass))
1991-12-30 04:19:53 +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 (optab_handler (unoptab, wider_mode) != CODE_FOR_nothing
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
|| optab_libfunc (unoptab, wider_mode))
1991-12-30 04:19:53 +01:00
{
rtx xop0 = op0;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
/* For certain operations, we need not actually extend
the narrow operand, as long as we will truncate the
results to the same narrowness. */
xop0 = widen_operand (xop0, wider_mode, mode, unsignedp,
(unoptab == neg_optab
|| unoptab == one_cmpl_optab
|| unoptab == bswap_optab)
&& mclass == MODE_INT);
1992-07-06 22:04:10 +02:00
temp = expand_unop (wider_mode, unoptab, xop0, NULL_RTX,
unsignedp);
/* If we are generating clz using wider mode, adjust the
result. Similarly for clrsb. */
if ((unoptab == clz_optab || unoptab == clrsb_optab)
&& temp != 0)
temp = expand_binop
(wider_mode, sub_optab, temp,
gen_int_mode (GET_MODE_PRECISION (wider_mode)
- GET_MODE_PRECISION (mode),
wider_mode),
target, true, OPTAB_DIRECT);
/* Likewise for bswap. */
if (unoptab == bswap_optab && temp != 0)
{
gcc_assert (GET_MODE_PRECISION (wider_mode)
== GET_MODE_BITSIZE (wider_mode)
&& GET_MODE_PRECISION (mode)
== GET_MODE_BITSIZE (mode));
temp = expand_shift (RSHIFT_EXPR, wider_mode, temp,
GET_MODE_BITSIZE (wider_mode)
- GET_MODE_BITSIZE (mode),
NULL_RTX, true);
}
if (temp)
1991-12-30 04:19:53 +01:00
{
if (mclass != 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
delete_insns_since (last);
1991-12-30 04:19:53 +01:00
}
}
}
/* One final attempt at implementing negation via subtraction,
this time allowing widening of the operand. */
if (optab_to_code (unoptab) == NEG && !HONOR_SIGNED_ZEROS (mode))
{
rtx temp;
temp = expand_binop (mode,
unoptab == negv_optab ? subv_optab : sub_optab,
CONST0_RTX (mode), op0,
target, unsignedp, OPTAB_LIB_WIDEN);
if (temp)
return temp;
}
1991-12-30 04:19:53 +01:00
return 0;
}
/* 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.
*/
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_abs_nojump (machine_mode mode, rtx op0, rtx target,
int result_unsignedp)
{
rtx temp;
if (GET_MODE_CLASS (mode) != MODE_INT
|| ! flag_trapv)
result_unsignedp = 1;
/* First try to do it with a special abs instruction. */
temp = expand_unop (mode, result_unsignedp ? abs_optab : absv_optab,
op0, target, 0);
if (temp != 0)
return temp;
/* For floating point modes, try clearing the sign bit. */
if (SCALAR_FLOAT_MODE_P (mode))
{
temp = expand_absneg_bit (ABS, mode, op0, target);
if (temp)
return temp;
}
[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 (optab_handler (smax_optab, mode) != CODE_FOR_nothing
&& !HONOR_SIGNED_ZEROS (mode))
[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
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
[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
temp = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
op0, NULL_RTX, 0);
[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 (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
OPTAB_WIDEN);
if (temp != 0)
return temp;
delete_insns_since (last);
}
/* If this machine has expensive jumps, we can do integer absolute
value of X as (((signed) x >> (W-1)) ^ x) - ((signed) x >> (W-1)),
where W is the width of MODE. */
optabs.c (expand_abs_nojump): Update BRANCH_COST call. * optabs.c (expand_abs_nojump): Update BRANCH_COST call. * fold-cost.c (LOGICAL_OP_NON_SHORT_CIRCUIT, fold_truthop): Likewise. * dojump.c (do_jump): Likewise. * ifcvt.c (MAX_CONDITIONAL_EXECUTE): Likewise. (note-if_info): Add BRANCH_COST. (noce_try_store_flag_constants, noce_try_addcc, noce_try_store_flag_mask, noce_try_cmove_arith, noce_try_cmove_arith, noce_try_cmove_arith, noce_find_if_block, find_if_case_1, find_if_case_2): Use compuated branch cost. * expr.h (BRANCH_COST): Update default. * predict.c (predictable_edge_p): New function. * expmed.c (expand_smod_pow2, expand_sdiv_pow2, emit_store_flag): Update BRANCH_COST call. * basic-block.h (predictable_edge_p): Declare. * config/alpha/alpha.h (BRANCH_COST): Update. * config/frv/frv.h (BRANCH_COST): Update. * config/s390/s390.h (BRANCH_COST): Update. * config/spu/spu.h (BRANCH_COST): Update. * config/sparc/sparc.h (BRANCH_COST): Update. * config/m32r/m32r.h (BRANCH_COST): Update. * config/i386/i386.h (BRANCH_COST): Update. * config/i386/i386.c (ix86_expand_int_movcc): Update use of BRANCH_COST. * config/sh/sh.h (BRANCH_COST): Update. * config/pdp11/pdp11.h (BRANCH_COST): Update. * config/avr/avr.h (BRANCH_COST): Update. * config/crx/crx.h (BRANCH_COST): Update. * config/xtensa/xtensa.h (BRANCH_COST): Update. * config/stormy16/stormy16.h (BRANCH_COST): Update. * config/m68hc11/m68hc11.h (BRANCH_COST): Update. * config/iq2000/iq2000.h (BRANCH_COST): Update. * config/ia64/ia64.h (BRANCH_COST): Update. * config/rs6000/rs6000.h (BRANCH_COST): Update. * config/arc/arc.h (BRANCH_COST): Update. * config/score/score.h (BRANCH_COST): Update. * config/arm/arm.h (BRANCH_COST): Update. * config/pa/pa.h (BRANCH_COST): Update. * config/mips/mips.h (BRANCH_COST): Update. * config/vax/vax.h (BRANCH_COST): Update. * config/h8300/h8300.h (BRANCH_COST): Update. * params.def (PARAM_PREDICTABLE_BRANCH_OUTCOME): New. * doc/invoke.texi (predictable-branch-cost-outcome): Document. * doc/tm.texi (BRANCH_COST): Update. From-SVN: r139804
2008-08-30 16:19:01 +02:00
if (GET_MODE_CLASS (mode) == MODE_INT
&& BRANCH_COST (optimize_insn_for_speed_p (),
false) >= 2)
{
rtx extended = expand_shift (RSHIFT_EXPR, mode, op0,
GET_MODE_PRECISION (mode) - 1,
NULL_RTX, 0);
temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
OPTAB_LIB_WIDEN);
if (temp != 0)
temp = expand_binop (mode, result_unsignedp ? sub_optab : subv_optab,
temp, extended, target, 0, OPTAB_LIB_WIDEN);
if (temp != 0)
return temp;
}
return NULL_RTX;
}
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_abs (machine_mode mode, rtx op0, rtx target,
int result_unsignedp, int safe)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx temp;
rtx_code_label *op1;
if (GET_MODE_CLASS (mode) != MODE_INT
|| ! flag_trapv)
result_unsignedp = 1;
temp = expand_abs_nojump (mode, op0, target, result_unsignedp);
if (temp != 0)
return temp;
/* If that does not win, use conditional jump and negate. */
/* 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)
&& REGNO (op0) >= FIRST_PSEUDO_REGISTER)
safe = 1;
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)
&& REGNO (target) < FIRST_PSEUDO_REGISTER))
target = gen_reg_rtx (mode);
emit_move_insn (target, op0);
NO_DEFER_POP;
do_compare_rtx_and_jump (target, CONST0_RTX (mode), GE, 0, mode,
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
NULL_RTX, NULL, op1, -1);
op0 = expand_unop (mode, result_unsignedp ? neg_optab : negv_optab,
target, target, 0);
if (op0 != target)
emit_move_insn (target, op0);
emit_label (op1);
OK_DEFER_POP;
return target;
}
/* Emit code to compute the one's complement absolute value of OP0
(if (OP0 < 0) OP0 = ~OP0), with result to TARGET if convenient.
(TARGET may be NULL_RTX.) 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. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_one_cmpl_abs_nojump (machine_mode mode, rtx op0, rtx target)
{
rtx temp;
/* Not applicable for floating point modes. */
if (FLOAT_MODE_P (mode))
return NULL_RTX;
/* If we have a MAX insn, we can do this as MAX (x, ~x). */
if (optab_handler (smax_optab, mode) != CODE_FOR_nothing)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
temp = expand_unop (mode, one_cmpl_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);
}
/* If this machine has expensive jumps, we can do one's complement
absolute value of X as (((signed) x >> (W-1)) ^ x). */
if (GET_MODE_CLASS (mode) == MODE_INT
&& BRANCH_COST (optimize_insn_for_speed_p (),
false) >= 2)
{
rtx extended = expand_shift (RSHIFT_EXPR, mode, op0,
GET_MODE_PRECISION (mode) - 1,
NULL_RTX, 0);
temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
OPTAB_LIB_WIDEN);
if (temp != 0)
return temp;
}
return NULL_RTX;
}
/* A subroutine of expand_copysign, perform the copysign operation using the
abs and neg primitives advertised to exist on the target. The assumption
is that we have a split register file, and leaving op0 in fp registers,
and not playing with subregs so much, will help the register allocator. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_copysign_absneg (machine_mode mode, rtx op0, rtx op1, rtx target,
int bitpos, bool op0_is_abs)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode imode;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
enum insn_code icode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx sign;
rtx_code_label *label;
if (target == op1)
target = NULL_RTX;
/* Check if the back end provides an insn that handles signbit for the
argument's mode. */
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
icode = optab_handler (signbit_optab, mode);
if (icode != CODE_FOR_nothing)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
imode = insn_data[(int) icode].operand[0].mode;
sign = gen_reg_rtx (imode);
emit_unop_insn (icode, sign, op1, UNKNOWN);
}
else
{
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
{
imode = int_mode_for_mode (mode);
if (imode == BLKmode)
return NULL_RTX;
op1 = gen_lowpart (imode, op1);
}
else
{
int word;
imode = word_mode;
if (FLOAT_WORDS_BIG_ENDIAN)
word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
else
word = bitpos / BITS_PER_WORD;
bitpos = bitpos % BITS_PER_WORD;
op1 = operand_subword_force (op1, word, mode);
}
2014-05-06 18:25:05 +02:00
wide_int mask = wi::set_bit_in_zero (bitpos, GET_MODE_PRECISION (imode));
sign = expand_binop (imode, and_optab, op1,
2014-05-06 18:25:05 +02:00
immed_wide_int_const (mask, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
}
if (!op0_is_abs)
{
op0 = expand_unop (mode, abs_optab, op0, target, 0);
if (op0 == NULL)
return NULL_RTX;
target = op0;
}
else
{
if (target == NULL_RTX)
target = copy_to_reg (op0);
else
emit_move_insn (target, op0);
}
label = gen_label_rtx ();
emit_cmp_and_jump_insns (sign, const0_rtx, EQ, NULL_RTX, imode, 1, label);
if (CONST_DOUBLE_AS_FLOAT_P (op0))
op0 = simplify_unary_operation (NEG, mode, op0, mode);
else
op0 = expand_unop (mode, neg_optab, op0, target, 0);
if (op0 != target)
emit_move_insn (target, op0);
emit_label (label);
return target;
}
/* A subroutine of expand_copysign, perform the entire copysign operation
with integer bitmasks. BITPOS is the position of the sign bit; OP0_IS_ABS
is true if op0 is known to have its sign bit clear. */
static rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_copysign_bit (machine_mode mode, rtx op0, rtx op1, rtx target,
int bitpos, bool op0_is_abs)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode imode;
int word, nwords, i;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx temp;
rtx_insn *insns;
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
{
imode = int_mode_for_mode (mode);
if (imode == BLKmode)
return NULL_RTX;
word = 0;
nwords = 1;
}
else
{
imode = word_mode;
if (FLOAT_WORDS_BIG_ENDIAN)
word = (GET_MODE_BITSIZE (mode) - bitpos) / BITS_PER_WORD;
else
word = bitpos / BITS_PER_WORD;
bitpos = bitpos % BITS_PER_WORD;
nwords = (GET_MODE_BITSIZE (mode) + BITS_PER_WORD - 1) / BITS_PER_WORD;
}
2014-05-06 18:25:05 +02:00
wide_int mask = wi::set_bit_in_zero (bitpos, GET_MODE_PRECISION (imode));
if (target == 0
|| target == op0
|| target == op1
|| (nwords > 1 && !valid_multiword_target_p (target)))
target = gen_reg_rtx (mode);
if (nwords > 1)
{
start_sequence ();
for (i = 0; i < nwords; ++i)
{
rtx targ_piece = operand_subword (target, i, 1, mode);
rtx op0_piece = operand_subword_force (op0, i, mode);
if (i == word)
{
if (!op0_is_abs)
op0_piece
= expand_binop (imode, and_optab, op0_piece,
2014-05-06 18:25:05 +02:00
immed_wide_int_const (~mask, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
op1 = expand_binop (imode, and_optab,
operand_subword_force (op1, i, mode),
2014-05-06 18:25:05 +02:00
immed_wide_int_const (mask, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
temp = expand_binop (imode, ior_optab, op0_piece, op1,
targ_piece, 1, OPTAB_LIB_WIDEN);
if (temp != targ_piece)
emit_move_insn (targ_piece, temp);
}
else
emit_move_insn (targ_piece, op0_piece);
}
insns = get_insns ();
end_sequence ();
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
emit_insn (insns);
}
else
{
op1 = expand_binop (imode, and_optab, gen_lowpart (imode, op1),
2014-05-06 18:25:05 +02:00
immed_wide_int_const (mask, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
op0 = gen_lowpart (imode, op0);
if (!op0_is_abs)
op0 = expand_binop (imode, and_optab, op0,
2014-05-06 18:25:05 +02:00
immed_wide_int_const (~mask, imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
temp = expand_binop (imode, ior_optab, op0, op1,
gen_lowpart (imode, target), 1, OPTAB_LIB_WIDEN);
target = lowpart_subreg_maybe_copy (mode, temp, imode);
}
return target;
}
/* Expand the C99 copysign operation. OP0 and OP1 must be the same
scalar floating point mode. Return NULL if we do not know how to
expand the operation inline. */
rtx
expand_copysign (rtx op0, rtx op1, rtx target)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (op0);
const struct real_format *fmt;
bool op0_is_abs;
rtx temp;
gcc_assert (SCALAR_FLOAT_MODE_P (mode));
gcc_assert (GET_MODE (op1) == mode);
/* First try to do it with a special instruction. */
temp = expand_binop (mode, copysign_optab, op0, op1,
target, 0, OPTAB_DIRECT);
if (temp)
return temp;
fmt = REAL_MODE_FORMAT (mode);
if (fmt == NULL || !fmt->has_signed_zero)
return NULL_RTX;
op0_is_abs = false;
if (CONST_DOUBLE_AS_FLOAT_P (op0))
{
if (real_isneg (CONST_DOUBLE_REAL_VALUE (op0)))
op0 = simplify_unary_operation (ABS, mode, op0, mode);
op0_is_abs = true;
}
if (fmt->signbit_ro >= 0
&& (CONST_DOUBLE_AS_FLOAT_P (op0)
|| (optab_handler (neg_optab, mode) != CODE_FOR_nothing
&& optab_handler (abs_optab, mode) != CODE_FOR_nothing)))
{
temp = expand_copysign_absneg (mode, op0, op1, target,
fmt->signbit_ro, op0_is_abs);
if (temp)
return temp;
}
if (fmt->signbit_rw < 0)
return NULL_RTX;
return expand_copysign_bit (mode, op0, op1, target,
fmt->signbit_rw, op0_is_abs);
}
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
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
the value that is stored into TARGET.
1991-12-30 04:19:53 +01:00
Return false if expansion failed. */
bool
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
maybe_emit_unop_insn (enum insn_code icode, rtx target, rtx op0,
enum rtx_code code)
1991-12-30 04:19:53 +01:00
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[2];
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
rtx_insn *pat;
1991-12-30 04:19:53 +01:00
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, GET_MODE (target));
create_input_operand (&ops[1], op0, GET_MODE (op0));
pat = maybe_gen_insn (icode, 2, ops);
if (!pat)
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
return false;
1991-12-30 04:19:53 +01:00
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
Work towards NEXT_INSN/PREV_INSN requiring insns as their params gcc/ 2014-08-28 David Malcolm <dmalcolm@redhat.com> * cfgexpand.c (pass_expand::execute): Strengthen local "after" from rtx to rtx_insn *. * cfgrtl.c (force_nonfallthru_and_redirect): Replace use of local rtx "note" with new local rtx_insn * "new_head" when calculating head insn of new basic block. * combine.c (combine_split_insns): Strengthen return type and local "ret" from rtx to rtx_insn *. (likely_spilled_retval_p): Likewise for locals "use" and "p". (try_combine): Eliminate local "m_split", splitting into new locals "m_split_insn" and "m_split_pat". (find_split_point): Strengthen local "seq" from rtx into rtx_insn *. * config/spu/spu.c (spu_machine_dependent_reorg): Likewise for locals "label", "branch". * config/spu/spu.md (define_expand "smulsi3_highpart"): Likewise for local "insn". (define_expand "umulsi3_highpart"): Likewise for local "insn". * dse.c (note_add_store_info): Likewise for fields "first", "current". (note_add_store): Likewise for local "insn". (emit_inc_dec_insn_before): Likewise for locals "insn", "new_insn", "cur". (find_shift_sequence): Likewise for locals "shift_seq", "insn". (replace_read): Likewise for locals "insns", "this_insn". * dwarf2cfi.c (dw_trace_info): Likewise for field "eh_head". (notice_eh_throw): Likewise for param "insn". (before_next_cfi_note): Likewise for return type, param, and local "prev". (connect_traces): Likewise for local "note". * emit-rtl.c (reset_all_used_flags): Likewise for local "p". (verify_rtl_sharing): Likewise. (unshare_all_rtl_in_chain): Likewise for param "insn". (get_first_nonnote_insn): Likewise for local "insn". (get_last_nonnote_insn): Likewise. Introduce local rtx_sequence * "seq" and use its methods to clarify things. (next_insn): Strengthen return type from rtx to rtx_insn *. Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (previous_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. Use a cast to and method of rtx_sequence to clarify the code. (next_nonnote_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping a checked cast made redundant by this change. (next_nonnote_insn_bb): Likewise. (prev_nonnote_insn): Likewise. (prev_nonnote_insn_bb): Likewise. (next_nondebug_insn): Likewise. (prev_nondebug_insn): Likewise. (next_nonnote_nondebug_insn): Likewise. (prev_nonnote_nondebug_insn): Likewise. (next_real_insn): Likewise. (prev_real_insn): Likewise. (next_active_insn): Likewise. (prev_active_insn): Likewise. (next_cc0_user): Likewise. Use rtx_sequence and a method for clarity. (prev_cc0_setter): Likewise. (try_split): Rename param "trial" to "uncast_trial" and reintroduce "insn" as a local rtx_insn * using a checked cast, dropping checked casts made redundant by this change. Strengthen locals "seq", "tem", "insn_last", "insn", "next" from rtx to rtx_insn *. (remove_insn): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. (emit_pattern_after_setloc): Likewise for param "after", as "uncast_after". (emit_pattern_after): Likewise. Strengthen local "prev" from rtx to rtx_insn *. (emit_pattern_before_setloc): Rename param "before" to "uncast_before" and reintroduce "before" as a local rtx_insn * using a checked cast. Strengthen locals "first", "last" from rtx to rtx_insn *. (emit_pattern_before): Likewise rename/cast param "before" to "uncast_before". Strengthen local "next" from rtx to rtx_insn *. * except.c (copy_reg_eh_region_note_forward): Strengthen param "first" and local "insn" from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise for param "last" and local "insn". * expr.c (fixup_args_size_notes): Rename param "last" to "uncast_last" and reintroduce "last" as a local rtx_insn * using a checked cast. Strengthen local "insn" from rtx to rtx_insn *. * function.c (set_insn_locations): Strengthen param "insn" from rtx to rtx_insn *. (record_insns): Likewise for param "insns" and local "tmp". (active_insn_between): Rename param "tail" to "uncast_tail" and reintroduce "tail" as a local rtx_insn * using a checked cast. (thread_prologue_and_epilogue_insns): Split out top-level local rtx "seq" into three different rtx_insn * locals. Strengthen local "prologue_seq" from rtx to rtx_insn *. * gcse.c (insert_insn_end_basic_block): Strenghen local "insn" from rtx to rtx_insn *. * haifa-sched.c (initiate_bb_reg_pressure_info): Likewise. (priority): Likewise for locals "prev_first", "twin". (setup_insn_max_reg_pressure): Likewise for param "after". (sched_setup_bb_reg_pressure_info): Likewise. (no_real_insns_p): Strengthen params from const_rtx to const rtx_insn *. (schedule_block): Strengthen local "next_tail" from rtx to rtx_insn *. * ifcvt.c (find_active_insn_before): Strengthen return type and param "insn" from rtx to rtx_insn *. (find_active_insn_after): Likewise. (cond_exec_process_insns): Likewise for param "start" and local "insn". (cond_exec_process_if_block): Likewise for locals "then_start", "then_end", "else_start", "else_end", "insn", "start", "end", "from". (noce_process_if_block): Likewise for local "jump". (merge_if_block): Likewise for two locals named "end". (cond_exec_find_if_block): Likewise for local "last_insn". * jump.c (delete_related_insns): Rename param "insn" to "uncast_insn" and reintroduce "insn" as a local rtx_insn * using a checked cast. Strengthen local "p" from rtx to rtx_insn *. * lra-constraints.c (inherit_reload_reg): Replace NULL_RTX with NULL. (split_reg): Likewise. * lra.c (lra_process_new_insns): Likewise. * modulo-sched.c (permute_partial_schedule): Strengthen param "last" from rtx to rtx_insn *. * optabs.c (add_equal_note): Likewise for param "insns" and local "last_insn". (expand_binop_directly): Add checked casts to rtx_insn * within NEXT_INSN (pat) uses. (expand_unop_direct): Likewise. (maybe_emit_unop_insn): Likewise. * recog.c (peep2_attempt): Strengthen locals "last", "before_try", "x" from rtx to rtx_insn *. * reorg.c (optimize_skip): Strengthen return type and local "delay_list" from rtx to rtx_insn_list *. Strengthen param "insn" and locals "trial", "next_trial" from rtx to rtx_insn *. * resource.c (next_insn_no_annul): Strengthen return type and param "insn" from rtx to rtx_insn *. Use a cast to and method of rtx_sequence to clarify the code. (mark_referenced_resources): Add a checked cast to rtx_insn * within PREV_INSN (x). (find_dead_or_set_registers): Strengthen return type, param "target", locals "insn", "next", "jump_insn", "this_jump_insn" from rtx to rtx_insn *. Strengthen param "jump_target" from rtx * to rtx_insn **. (mark_target_live_regs): Strengthen params "insns" and "target", locals "insn", "jump_target", "start_insn", "stop_insn" from rtx to rtx_insn *. Use cast to and method of rtx_sequence to clarify the code. * resource.h (mark_target_live_regs): Strengthen params 1 and 2 from rtx to rtx_insn *. * rtl.h (copy_reg_eh_region_note_forward): Strengthen second param from rtx to rtx_insn *. (copy_reg_eh_region_note_backward): Likewise. (unshare_all_rtl_in_chain): Likewise for sole param. (dump_rtl_slim): Strengthen second and third params from const_rtx to const rtx_insn *. * sched-deps.c (sched_free_deps): Strengthen params "head" and "tail" and locals "insn", "next_tail" from rtx to rtx_insn *. * sched-ebb.c (init_ready_list): Strengthen locals "prev_head", "next_tail" from rtx to rtx_insn *. (begin_move_insn): Likewise for local "next". * sched-int.h (sched_free_deps): Likewise for first and second params. (no_real_insns_p): Strengthen both params from const_rtx to const rtx_insn *. (sched_setup_bb_reg_pressure_info): Strengthen second params from rtx to rtx_insn *. * sched-rgn.c (init_ready_list): Likewise for locals "prev_head", "next_tail". * sched-vis.c (dump_rtl_slim): Strengthen params "first", "last" and locals "insn", "tail" from const_rtx to const rtx_insn *. (rtl_dump_bb_for_graph): Strengthen local "insn" from rtx to rtx_insn *. (debug_rtl_slim): Strengthen params "first" and "last" from const_rtx to const rtx_insn *. * shrink-wrap.c (try_shrink_wrapping): Strengthen param "prologue_seq" and locals "seq", "p_insn" from rtx to rtx_insn *. (convert_to_simple_return): Likewise for param "returnjump". * shrink-wrap.h (try_shrink_wrapping): Likewise for param "prologue_seq". (convert_to_simple_return): Likewise for param "returnjump". * valtrack.c (propagate_for_debug): Likewise for params "insn", "last". * valtrack.h (propagate_for_debug): Likewise for second param. From-SVN: r214693
2014-08-28 22:45:40 +02:00
&& code != UNKNOWN)
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
add_equal_note (pat, ops[0].value, code, ops[1].value, NULL_RTX);
1991-12-30 04:19:53 +01:00
emit_insn (pat);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (ops[0].value != target)
emit_move_insn (target, ops[0].value);
return true;
}
/* 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
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
emit_unop_insn (enum insn_code icode, rtx target, rtx op0, enum rtx_code code)
{
bool ok = maybe_emit_unop_insn (icode, target, op0, code);
gcc_assert (ok);
1991-12-30 04:19:53 +01:00
}
struct no_conflict_data
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx target;
rtx_insn *first, *insn;
bool must_stay;
};
rtl.texi: Removed reference to REG_NO_CONFLICT notes. 2008-05-14 Kenneth Zadeck <zadeck@naturalbridge.com> * doc/rtl.texi: Removed reference to REG_NO_CONFLICT notes. * optabs.c (expand_binop, expand_absneg_bit, expand_unop, expand_copysign_bit, ): Change call to emit_no_conflict_block to emit_insn and remove unneeded code to construct extra args. (emit_no_conflict_block): Removed. * optabls.h: (emit_no_conflict_block): Removed. * cse.c (cse_extended_basic_block): Remove search for REG_NO_CONFLICT note. * global.c: Removed incorrect comment added in revision 117. * expr.c (convert_move): Change call to emit_no_conflict_block to emit_insn. * recog.c: Change comments so that they do not mention REG_NO_CONFLICT. * local_alloc.c (combine_regs): Removed last parameter. (no_conflict_p): Removed. (block_alloc): Removed note, no_conflict_combined_regno and set local vars. Removed all code to process REG_NO_CONFLICT blocks. (combine_regs): Removed already_dead and code to look for REG_NO_CONFLICT notes. * lower_subreg (remove_retval_note): Removed code to look for REG_NO_CONFLICT block. (resolve_reg_notes): Removed REG_NO_CONFLICT case. (resolve_clobber): Remove code to process libcalls that have REG_NO_CONFLICT notes. * loop_invariant.c (find_invariant_insn): Removed REG_NO_CONFLICT case. * combine.c (can_combine_p, distribute_notes): Removed REG_NO_CONFLICT case. * config/cris/cris.md (movdi pattern): Changed emit_no_conflict_block to emit_insns. * config/mn10300/mn10300.md (absdf2, negdf2 patterns): Ditto. * config/m68k/m68k.md (negdf2, negxf2, absdf2, absxf2 patterns): Ditto. * reg-notes.def (NO_CONFLICT): Removed. From-SVN: r135289
2008-05-14 14:24:43 +02:00
/* Called via note_stores by emit_libcall_block. Set P->must_stay if
the currently examined clobber / store has to stay in the list of
insns that constitute the actual libcall block. */
static void
alias.c (record_set, [...]): Constify. * alias.c (record_set, memory_modified_1): Constify. * bt-load.c (note_btr_set): Likewise. * caller-save.c (mark_set_regs, add_stored_regs): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, expand_field_assignment, record_dead_and_set_regs_1, use_crosses_set_p, reg_dead_at_p_1, can_combine_p, likely_spilled_retval_1): Likewise. * config/frv/frv.c (frv_registers_update_1, frv_io_check_address, frv_io_handle_set): Likewise. * config/mips/mips.c (mips_sim_record_set, vr4130_true_reg_dependence_p_1): Likewise. * config/mt/mt.c (insn_dependent_p_1): Likewise. * config/s390/s390.c (s390_reg_clobbered_rtx): Likewise. * config/sh/sh.c (flow_dependent_p_1): Likewise. * cselib.c (cselib_invalidate_rtx_note_stores): Likewise. * dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise. * ddg.c (mark_mem_store): Likewise. * df-problems.c (df_urec_mark_reg_change): Likewise. * function.c (update_epilogue_consts): Likewise. * gcse.c (record_set_info, record_last_set_info, mems_conflict_for_gcse_p, canon_list_insert, reg_set_info, reg_clear_last_set): Likewise. * global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live): Likewise. * jump.c (reversed_comparison_code_parts): Likewise. * local-alloc.c (validate_equiv_mem_from_store, no_equiv, reg_is_set): Likewise. * loop-iv.c (mark_altered): Likewise. * mode-switching.c (reg_becomes_live): Likewise. * optabs.c (no_conflict_move_test): Likewise. * postreload-gcse.c (record_last_set_info, find_mem_conflicts): Likewise. * postreload.c (reload_combine_note_store, move2add_note_store): Likewise. * regmove.c (flags_set_1): Likewise. * regrename.c (note_sets, kill_clobbered_value, kill_set_value): Likewise. * reload1.c (mark_not_eliminable, forget_old_reloads_1): Likewise. * resource.c (update_live_status): Likewise. * rtl.h (set_of, note_stores): Likewise. * rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of, note_stores, parms_set): Likewise. * sched-rgn.c (sets_likely_spilled_1): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. * var-tracking.c (count_stores, add_stores): Likewise. From-SVN: r127065
2007-07-30 18:30:18 +02:00
no_conflict_move_test (rtx dest, const_rtx set, void *p0)
{
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
struct no_conflict_data *p= (struct no_conflict_data *) p0;
/* If this inns directly contributes to setting the target, it must stay. */
if (reg_overlap_mentioned_p (p->target, dest))
p->must_stay = true;
/* If we haven't committed to keeping any other insns in the list yet,
there is nothing more to check. */
else if (p->insn == p->first)
return;
/* If this insn sets / clobbers a register that feeds one of the insns
already in the list, this insn has to stay too. */
else if (reg_overlap_mentioned_p (dest, PATTERN (p->first))
|| (CALL_P (p->first) && (find_reg_fusage (p->first, USE, dest)))
|| reg_used_between_p (dest, p->first, p->insn)
/* Likewise if this insn depends on a register set by a previous
insn in the list, or if it sets a result (presumably a hard
register) that is set or clobbered by a previous insn.
N.B. the modified_*_p (SET_DEST...) tests applied to a MEM
SET_DEST perform the former check on the address, and the latter
check on the MEM. */
|| (GET_CODE (set) == SET
&& (modified_in_p (SET_SRC (set), p->first)
|| modified_in_p (SET_DEST (set), p->first)
|| modified_between_p (SET_SRC (set), p->first, p->insn)
|| modified_between_p (SET_DEST (set), p->first, p->insn))))
p->must_stay = true;
}
1991-12-30 04:19:53 +01:00
/* 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. */
static void
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
emit_libcall_block_1 (rtx_insn *insns, rtx target, rtx result, rtx equiv,
bool equiv_may_trap)
1991-12-30 04:19:53 +01:00
{
rtx final_dest = target;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *next, *last, *insn;
1991-12-30 04:19:53 +01: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));
/* If we're using non-call exceptions, a libcall corresponding to an
operation that may trap may also trap. */
/* ??? See the comment in front of make_reg_eh_region_note. */
if (cfun->can_throw_non_call_exceptions
&& (equiv_may_trap || 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))
{
rtx note = find_reg_note (insn, REG_EH_REGION, NULL_RTX);
if (note)
{
int lp_nr = INTVAL (XEXP (note, 0));
if (lp_nr == 0 || lp_nr == INT_MIN)
remove_note (insn, note);
}
}
}
else
{
/* Look for any CALL_INSNs in this sequence, and attach a REG_EH_REGION
reg note to indicate that this call cannot throw or execute a nonlocal
goto (unless there is already a REG_EH_REGION note, in which case
we update it). */
for (insn = insns; insn; insn = NEXT_INSN (insn))
if (CALL_P (insn))
make_reg_eh_region_note_nothrow_nononlocal (insn);
}
1991-12-30 04:19:53 +01:00
/* First emit all insns that set pseudos. Remove them from the list as
we go. Avoid insns that set pseudos which were referenced in previous
insns. These can be generated by move_by_pieces, for example,
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);
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))
&& REGNO (SET_DEST (set)) >= FIRST_PSEUDO_REGISTER)
1991-12-30 04:19:53 +01:00
{
struct no_conflict_data data;
data.target = const0_rtx;
data.first = insns;
data.insn = insn;
data.must_stay = 0;
note_stores (PATTERN (insn), no_conflict_move_test, &data);
if (! data.must_stay)
{
if (PREV_INSN (insn))
Split NEXT_INSN/PREV_INSN into lvalue and rvalue forms / 2014-08-19 David Malcolm <dmalcolm@redhat.com> * rtx-classes-status.txt: Add SET_NEXT_INSN, SET_PREV_INSN. gcc/ 2014-08-19 David Malcolm <dmalcolm@redhat.com> * rtl.h (PREV_INSN): Split macro in two: the existing one, for rvalues, and... (SET_PREV_INSN): New macro, for use as an lvalue. (NEXT_INSN, SET_NEXT_INSN): Likewise. * caller-save.c (save_call_clobbered_regs): Convert lvalue use of PREV_INSN/NEXT_INSN into SET_PREV_INSN/SET_NEXT_INSN. * cfgrtl.c (try_redirect_by_replacing_jump): Likewise. (fixup_abnormal_edges): Likewise. (unlink_insn_chain): Likewise. (fixup_reorder_chain): Likewise. (cfg_layout_delete_block): Likewise. (cfg_layout_merge_blocks): Likewise. * combine.c (update_cfg_for_uncondjump): Likewise. * emit-rtl.c (link_insn_into_chain): Likewise. (remove_insn): Likewise. (delete_insns_since): Likewise. (reorder_insns_nobb): Likewise. (emit_insn_after_1): Likewise. * final.c (rest_of_clean_state): Likewise. (final_scan_insn): Likewise. * gcse.c (can_assign_to_reg_without_clobbers_p): Likewise. * haifa-sched.c (concat_note_lists): Likewise. (remove_notes): Likewise. (restore_other_notes): Likewise. (move_insn): Likewise. (unlink_bb_notes): Likewise. (restore_bb_notes): Likewise. * jump.c (delete_for_peephole): Likewise. * optabs.c (emit_libcall_block_1): Likewise. * reorg.c (emit_delay_sequence): Likewise. (fill_simple_delay_slots): Likewise. * sel-sched-ir.c (sel_move_insn): Likewise. (sel_remove_insn): Likewise. (get_bb_note_from_pool): Likewise. * sel-sched.c (move_nop_to_previous_block): Likewise. * config/bfin/bfin.c (reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (gen_one_bundle): Likewise. (c6x_gen_bundles): Likewise. (hwloop_optimize): Likewise. * config/frv/frv.c (frv_function_prologue): Likewise. (frv_register_nop): Likewise. * config/ia64/ia64.c (ia64_init_dfa_pre_cycle_insn): Likewise. (ia64_reorg): Likewise. * config/mep/mep.c (mep_reorg_addcombine): Likewise. (mep_make_bundle): Likewise. (mep_bundle_insns): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/tilegx/tilegx.c (reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (reorder_var_tracking_notes): Likewise. From-SVN: r214128
2014-08-19 02:54:22 +02:00
SET_NEXT_INSN (PREV_INSN (insn)) = next;
else
insns = next;
1991-12-30 04:19:53 +01:00
if (next)
Split NEXT_INSN/PREV_INSN into lvalue and rvalue forms / 2014-08-19 David Malcolm <dmalcolm@redhat.com> * rtx-classes-status.txt: Add SET_NEXT_INSN, SET_PREV_INSN. gcc/ 2014-08-19 David Malcolm <dmalcolm@redhat.com> * rtl.h (PREV_INSN): Split macro in two: the existing one, for rvalues, and... (SET_PREV_INSN): New macro, for use as an lvalue. (NEXT_INSN, SET_NEXT_INSN): Likewise. * caller-save.c (save_call_clobbered_regs): Convert lvalue use of PREV_INSN/NEXT_INSN into SET_PREV_INSN/SET_NEXT_INSN. * cfgrtl.c (try_redirect_by_replacing_jump): Likewise. (fixup_abnormal_edges): Likewise. (unlink_insn_chain): Likewise. (fixup_reorder_chain): Likewise. (cfg_layout_delete_block): Likewise. (cfg_layout_merge_blocks): Likewise. * combine.c (update_cfg_for_uncondjump): Likewise. * emit-rtl.c (link_insn_into_chain): Likewise. (remove_insn): Likewise. (delete_insns_since): Likewise. (reorder_insns_nobb): Likewise. (emit_insn_after_1): Likewise. * final.c (rest_of_clean_state): Likewise. (final_scan_insn): Likewise. * gcse.c (can_assign_to_reg_without_clobbers_p): Likewise. * haifa-sched.c (concat_note_lists): Likewise. (remove_notes): Likewise. (restore_other_notes): Likewise. (move_insn): Likewise. (unlink_bb_notes): Likewise. (restore_bb_notes): Likewise. * jump.c (delete_for_peephole): Likewise. * optabs.c (emit_libcall_block_1): Likewise. * reorg.c (emit_delay_sequence): Likewise. (fill_simple_delay_slots): Likewise. * sel-sched-ir.c (sel_move_insn): Likewise. (sel_remove_insn): Likewise. (get_bb_note_from_pool): Likewise. * sel-sched.c (move_nop_to_previous_block): Likewise. * config/bfin/bfin.c (reorder_var_tracking_notes): Likewise. * config/c6x/c6x.c (gen_one_bundle): Likewise. (c6x_gen_bundles): Likewise. (hwloop_optimize): Likewise. * config/frv/frv.c (frv_function_prologue): Likewise. (frv_register_nop): Likewise. * config/ia64/ia64.c (ia64_init_dfa_pre_cycle_insn): Likewise. (ia64_reorg): Likewise. * config/mep/mep.c (mep_reorg_addcombine): Likewise. (mep_make_bundle): Likewise. (mep_bundle_insns): Likewise. * config/picochip/picochip.c (reorder_var_tracking_notes): Likewise. * config/tilegx/tilegx.c (reorder_var_tracking_notes): Likewise. * config/tilepro/tilepro.c (reorder_var_tracking_notes): Likewise. From-SVN: r214128
2014-08-19 02:54:22 +02:00
SET_PREV_INSN (next) = PREV_INSN (insn);
1991-12-30 04:19:53 +01:00
add_insn (insn);
}
1991-12-30 04:19:53 +01: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))
break;
1991-12-30 04:19:53 +01:00
}
/* 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);
set_dst_reg_note (last, REG_EQUAL, copy_rtx (equiv), target);
1991-12-30 04:19:53 +01:00
if (final_dest != target)
emit_move_insn (final_dest, target);
1991-12-30 04:19:53 +01:00
}
void
emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
emit_libcall_block_1 (safe_as_a <rtx_insn *> (insns),
target, result, equiv, false);
}
1991-12-30 04:19:53 +01:00
/* Nonzero if we can perform a comparison of mode MODE straightforwardly.
rtl.def: Add unordered fp comparisions. * rtl.def: Add unordered fp comparisions. * tree.def: Likewise. * tree.h: Add ISO C 9x unordered fp comparision builtins. * builtins.c (expand_tree_builtin): New function. * c-typeck.c (build_function_call): Use it. (build_binary_op): Support unordered compares. * c-common.c (c_common_nodes_and_builtins): Add unordered compares. * combine.c (known_cond): Handle reverse_condition returning UNKNOWN. (reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed. * cse.c (fold_rtx): Check FLOAT_MODE_P before reversing. (record_jump_equiv): Handle reverse_condition returning UNKNOWN. * jump.c (reverse_condition): Don't abort for UNLE etc, but return UNKNOWN. (swap_condition): Handle unordered compares. (thread_jumps): Check can_reverse before reversing. * loop.c (get_condition): Likewise. Allow UNORERED/ORDERED to be reversed for FP. * optabs.c (can_compare_p): New argument CODE. Verify branch or setcc is present before acking for cmp_optab. Update all callers. (prepare_float_lib_cmp, init_optabs): Handle UNORDERED. * expmed.c (do_cmp_and_jump): Update for can_compare_p. * expr.c (expand_expr): Likewise. Support unordered compares. (do_jump, do_store_flag): Likewise. * expr.h (enum libfunc_index): Add unordered compares. * Makefile.in (FPBIT_FUNCS): Add _unord_sf. (DPBIT_FUNCS): Add _unord_df. * config/fp-bit.c (_unord_f2): New. * fp-test.c (main): Try unordered compare builtins. * alpha-protos.h (alpha_fp_comparison_operator): Declare. * alpha.c (alpha_comparison_operator): Check mode properly. (alpha_swapped_comparison_operator): Likewise. (signed_comparison_operator): Likewise. (alpha_fp_comparison_operator): New. (alpha_emit_conditional_branch): Handle unordered compares. * alpha.h (PREDICATE_CODES): Update. * alpha.md (fp compares): Use alpha_fp_comparison_operator. (bunordered, bordered): New. * cp/call.c (build_over_call): Use expand_tree_builtin. * cp/typeck.c (build_function_call_real): Likewise. (build_binary_op_nodefault): Handle unordered compares. * gcc.c-torture/execute/ieee/fp-cmp-4.c: New. From-SVN: r31591
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
required to implement all of the normal bcc operations, but not
rtl.def: Add unordered fp comparisions. * rtl.def: Add unordered fp comparisions. * tree.def: Likewise. * tree.h: Add ISO C 9x unordered fp comparision builtins. * builtins.c (expand_tree_builtin): New function. * c-typeck.c (build_function_call): Use it. (build_binary_op): Support unordered compares. * c-common.c (c_common_nodes_and_builtins): Add unordered compares. * combine.c (known_cond): Handle reverse_condition returning UNKNOWN. (reversible_comparison_p): Allow UNORDERED/ORDERED to be reversed. * cse.c (fold_rtx): Check FLOAT_MODE_P before reversing. (record_jump_equiv): Handle reverse_condition returning UNKNOWN. * jump.c (reverse_condition): Don't abort for UNLE etc, but return UNKNOWN. (swap_condition): Handle unordered compares. (thread_jumps): Check can_reverse before reversing. * loop.c (get_condition): Likewise. Allow UNORERED/ORDERED to be reversed for FP. * optabs.c (can_compare_p): New argument CODE. Verify branch or setcc is present before acking for cmp_optab. Update all callers. (prepare_float_lib_cmp, init_optabs): Handle UNORDERED. * expmed.c (do_cmp_and_jump): Update for can_compare_p. * expr.c (expand_expr): Likewise. Support unordered compares. (do_jump, do_store_flag): Likewise. * expr.h (enum libfunc_index): Add unordered compares. * Makefile.in (FPBIT_FUNCS): Add _unord_sf. (DPBIT_FUNCS): Add _unord_df. * config/fp-bit.c (_unord_f2): New. * fp-test.c (main): Try unordered compare builtins. * alpha-protos.h (alpha_fp_comparison_operator): Declare. * alpha.c (alpha_comparison_operator): Check mode properly. (alpha_swapped_comparison_operator): Likewise. (signed_comparison_operator): Likewise. (alpha_fp_comparison_operator): New. (alpha_emit_conditional_branch): Handle unordered compares. * alpha.h (PREDICATE_CODES): Update. * alpha.md (fp compares): Use alpha_fp_comparison_operator. (bunordered, bordered): New. * cp/call.c (build_over_call): Use expand_tree_builtin. * cp/typeck.c (build_function_call_real): Likewise. (build_binary_op_nodefault): Handle unordered compares. * gcc.c-torture/execute/ieee/fp-cmp-4.c: New. From-SVN: r31591
2000-01-24 21:10:04 +01:00
required to implement all (or any) of the unordered bcc operations. */
int
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_compare_p (enum rtx_code code, machine_mode mode,
enum can_compare_purpose purpose)
{
rtx test;
test = gen_rtx_fmt_ee (code, mode, const0_rtx, const0_rtx);
do
{
enum insn_code icode;
if (purpose == ccp_jump
&& (icode = optab_handler (cbranch_optab, mode)) != CODE_FOR_nothing
&& insn_operand_matches (icode, 0, test))
return 1;
if (purpose == ccp_store_flag
&& (icode = optab_handler (cstore_optab, mode)) != CODE_FOR_nothing
&& insn_operand_matches (icode, 1, test))
return 1;
if (purpose == ccp_cmov
&& optab_handler (cmov_optab, mode) != CODE_FOR_nothing)
return 1;
mode = GET_MODE_WIDER_MODE (mode);
PUT_MODE (test, mode);
}
while (mode != VOIDmode);
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;
this matters if they need to be widened (as given by METHODS).
1991-12-30 04:19:53 +01:00
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
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
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
lambda.h (lambda_vector_min_nz): Likewise. * lambda.h (lambda_vector_min_nz): Likewise. * langhooks.h (struct lang_hooks_for_types, struct lang_hooks): Likewise. * output.h (assemble_integer, this_is_asm_operands): Likewise. * tree.h: Likewise. * vec.h: Likewise. * tree-flow-inline.h (relink_imm_use): Use gcc_assert. * optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword comments to avoid 'abort'. Use gcc_assert as necessary. * opts.c (common_handle_option): Likewise. * pretty-print.c (pp_base_format_text): Likewise. * print-rtl.c (print_rtx): Likewise. * read-rtl.c (read_rtx_filename, read_rtx_1): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_valid_class, find_reloads_toplev, find_equiv_reg): Likewise. * reload1.c (reload, forget_old_reloads_1, function_invariant_p, merge_assigned_reloads): Likewise. * tree-inline.c (inline_forbidden_p_1, estimate_num_insns_1): Likewise. * tree-optimize.c (execute_todo): Likewise. * tree-outof-ssa.c (eliminate_phi): Likewise. * tree-ssa-alias.c (add_pointed_to_expr): Likewise. * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise. * tree-ssa-operands.c (parse_ssa_operands, get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise. * tree-ssa-pre.c (find_or_generate_expression): Likewise. * tree-ssanames.c (release_ssa_name): Likewise. * tree.c (int_bit_position, int_byte_position, tree_low_cst, walk_tree): Likewise. * tree-ssa-operands.c (verify_abort): Fold into .. (verify_imm_links): ... here. From-SVN: r98519
2005-04-21 20:05:34 +02:00
should perform the comparison on the modified values. Constant
comparisons must have already been folded. */
1991-12-30 04:19:53 +01:00
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
2001-11-16 00:44:58 +01:00
static void
prepare_cmp_insn (rtx x, rtx y, enum rtx_code comparison, rtx size,
int unsignedp, enum optab_methods methods,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
rtx *ptest, machine_mode *pmode)
1991-12-30 04:19:53 +01:00
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = *pmode;
rtx libfunc, test;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode cmp_mode;
enum mode_class mclass;
/* The other methods are not needed. */
gcc_assert (methods == OPTAB_DIRECT || methods == OPTAB_WIDEN
|| methods == OPTAB_LIB_WIDEN);
1991-12-30 04:19:53 +01:00
/* If we are optimizing, force expensive constants into a register. */
if (CONSTANT_P (x) && optimize
target.def (rtx_costs): Remove "code" param, add "mode". * target.def (rtx_costs): Remove "code" param, add "mode". * rtl.h (rtx_cost, get_full_rtx_cost): Update prototype. (set_src_cost, get_full_set_src_cost): Likewise. Move later in file. (set_rtx_cost, get_full_set_rtx_cost): Move later in file. * rtlanal.c (rtx_cost): Add "mode" parameter. Update targetm.rtx_costs call. Track mode when given in rtx. (get_full_rtx_cost): Add "mode" parameter. Update rtx_cost calls. (default_address_cost): Pass Pmode to rtx_cost. (insn_rtx_cost): Pass dest mode of set to set_src_cost. * cprop.c (try_replace_reg): Ensure set_rtx_cost is not called with NULL set. * cse.c (COST, COST_IN): Add MODE param. Update all uses. (notreg_cost): Add mode param. Use it. * gcse.c (want_to_gcse_p): Delete forward declaration. Add mode param and pass to set_src_cost. Update all calls. (hash_scan_set): Formatting. * hooks.c (hook_bool_rtx_int_int_int_intp_bool_false): Delete. (hook_bool_rtx_mode_int_int_intp_bool_false): New function. * hooks.h: Ditto. * expmed.c (init_expmed_one_conv, init_expmed_one_mode, init_expmed, expand_mult, mult_by_coeff_cost, expand_smod_pow2, emit_store_flag): Update set_src_cost and rtx_cost calls. * auto-inc-dec.c (attempt_change): Likewise. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction, force_to_mode, distribute_and_simplify_rtx): Likewise. * dojump.c (prefer_and_bit_test): Likewise. * dse.c (find_shift_sequence): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * lower-subreg.c (shift_cost, compute_costs): Likewise. * optabs.c (avoid_expensive_constant, prepare_cmp_insn, lshift_cheap_p): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns, note_reg_elim_costly): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Delete "code" param, add "mode" param. Use "mode: in place of GET_MODE (x). Pass mode to rtx_cost calls. * config/alpha/alpha.c (alpha_rtx_costs): Likewise. * config/arc/arc.c (arc_rtx_costs): Likewise. * config/arm/arm.c (arm_rtx_costs): Likewise. * config/avr/avr.c (avr_rtx_costs, avr_rtx_costs_1): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/epiphany/epiphany.c (epiphany_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_rtx_costs): Likewise. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_rtx_costs): Likewise. * config/msp430/msp430.c (msp430_rtx_costs): Likewise. * config/nds32/nds32-cost.c (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32-protos.h (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32.c (nds32_rtx_costs): Likewise. * config/nios2/nios2.c (nios2_rtx_costs): Likewise. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/rl78/rl78.c (rl78_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/tilegx/tilegx.c (tilegx_rtx_costs): Likewise. * config/tilepro/tilepro.c (tilepro_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/visium/visium.c (visium_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Change type of "code" param, and pass as outer_code to first rtx_cost call. Pass mode to rtx_cost calls. (aarch64_address_cost, aarch64_if_then_else_costs): Update rtx_cost calls. (aarch64_rtx_costs_wrapper): Update. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs, arm_unspec_cost, arm_new_rtx_costs, arm_slowmul_rtx_costs): Update rtx_cost calls. * config/avr/avr.c (avr_final_prescan_insn): Update set_src_cost and rtx_cost calls. (avr_operand_rtx_cost): Similarly. (avr_rtx_costs_1): Correct mode passed to avr_operand_rtx_cost for subexpressions of ZERO_EXTEND, SIGN_EXTEND and COMPARE. * config/mips/mips.c (mips_stack_address_p): Comment typo. (mips_binary_cost): Update rtx_cost and set_src_cost calls. (mips_rtx_costs): Use GET_MODE (x) to detect const_int. * config/mn10300/mn10300.c (mn10300_address_cost): Pass Pmode to rtx_cost. (mn10300_rtx_costs): Correct mode passed to mn10300_address_cost. * config/rs6000/rs6000.c (rs6000_debug_rtx_costs): Update. * config/sh/sh.c (and_xor_ior_costs): Update rtx_cost call. * doc/tm.texi: Regenerate. From-SVN: r225532
2015-07-08 05:02:27 +02:00
&& (rtx_cost (x, mode, COMPARE, 0, optimize_insn_for_speed_p ())
> COSTS_N_INSNS (1)))
x = force_reg (mode, x);
if (CONSTANT_P (y) && optimize
target.def (rtx_costs): Remove "code" param, add "mode". * target.def (rtx_costs): Remove "code" param, add "mode". * rtl.h (rtx_cost, get_full_rtx_cost): Update prototype. (set_src_cost, get_full_set_src_cost): Likewise. Move later in file. (set_rtx_cost, get_full_set_rtx_cost): Move later in file. * rtlanal.c (rtx_cost): Add "mode" parameter. Update targetm.rtx_costs call. Track mode when given in rtx. (get_full_rtx_cost): Add "mode" parameter. Update rtx_cost calls. (default_address_cost): Pass Pmode to rtx_cost. (insn_rtx_cost): Pass dest mode of set to set_src_cost. * cprop.c (try_replace_reg): Ensure set_rtx_cost is not called with NULL set. * cse.c (COST, COST_IN): Add MODE param. Update all uses. (notreg_cost): Add mode param. Use it. * gcse.c (want_to_gcse_p): Delete forward declaration. Add mode param and pass to set_src_cost. Update all calls. (hash_scan_set): Formatting. * hooks.c (hook_bool_rtx_int_int_int_intp_bool_false): Delete. (hook_bool_rtx_mode_int_int_intp_bool_false): New function. * hooks.h: Ditto. * expmed.c (init_expmed_one_conv, init_expmed_one_mode, init_expmed, expand_mult, mult_by_coeff_cost, expand_smod_pow2, emit_store_flag): Update set_src_cost and rtx_cost calls. * auto-inc-dec.c (attempt_change): Likewise. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction, force_to_mode, distribute_and_simplify_rtx): Likewise. * dojump.c (prefer_and_bit_test): Likewise. * dse.c (find_shift_sequence): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * lower-subreg.c (shift_cost, compute_costs): Likewise. * optabs.c (avoid_expensive_constant, prepare_cmp_insn, lshift_cheap_p): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns, note_reg_elim_costly): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Delete "code" param, add "mode" param. Use "mode: in place of GET_MODE (x). Pass mode to rtx_cost calls. * config/alpha/alpha.c (alpha_rtx_costs): Likewise. * config/arc/arc.c (arc_rtx_costs): Likewise. * config/arm/arm.c (arm_rtx_costs): Likewise. * config/avr/avr.c (avr_rtx_costs, avr_rtx_costs_1): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/epiphany/epiphany.c (epiphany_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_rtx_costs): Likewise. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_rtx_costs): Likewise. * config/msp430/msp430.c (msp430_rtx_costs): Likewise. * config/nds32/nds32-cost.c (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32-protos.h (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32.c (nds32_rtx_costs): Likewise. * config/nios2/nios2.c (nios2_rtx_costs): Likewise. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/rl78/rl78.c (rl78_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/tilegx/tilegx.c (tilegx_rtx_costs): Likewise. * config/tilepro/tilepro.c (tilepro_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/visium/visium.c (visium_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Change type of "code" param, and pass as outer_code to first rtx_cost call. Pass mode to rtx_cost calls. (aarch64_address_cost, aarch64_if_then_else_costs): Update rtx_cost calls. (aarch64_rtx_costs_wrapper): Update. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs, arm_unspec_cost, arm_new_rtx_costs, arm_slowmul_rtx_costs): Update rtx_cost calls. * config/avr/avr.c (avr_final_prescan_insn): Update set_src_cost and rtx_cost calls. (avr_operand_rtx_cost): Similarly. (avr_rtx_costs_1): Correct mode passed to avr_operand_rtx_cost for subexpressions of ZERO_EXTEND, SIGN_EXTEND and COMPARE. * config/mips/mips.c (mips_stack_address_p): Comment typo. (mips_binary_cost): Update rtx_cost and set_src_cost calls. (mips_rtx_costs): Use GET_MODE (x) to detect const_int. * config/mn10300/mn10300.c (mn10300_address_cost): Pass Pmode to rtx_cost. (mn10300_rtx_costs): Correct mode passed to mn10300_address_cost. * config/rs6000/rs6000.c (rs6000_debug_rtx_costs): Update. * config/sh/sh.c (and_xor_ior_costs): Update rtx_cost call. * doc/tm.texi: Regenerate. From-SVN: r225532
2015-07-08 05:02:27 +02:00
&& (rtx_cost (y, mode, COMPARE, 1, optimize_insn_for_speed_p ())
> COSTS_N_INSNS (1)))
y = force_reg (mode, y);
always define HAVE_cc0 gcc/ChangeLog: 2015-04-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org> * genconfig.c (main): Always define HAVE_cc0. * caller-save.c (insert_one_insn): Change ifdef HAVE_cc0 to #if HAVE_cc0. * cfgcleanup.c (flow_find_cross_jump): Likewise. (flow_find_head_matching_sequence): Likewise. (try_head_merge_bb): Likewise. * cfgrtl.c (rtl_merge_blocks): Likewise. (try_redirect_by_replacing_jump): Likewise. (rtl_tidy_fallthru_edge): Likewise. * combine.c (do_SUBST_MODE): Likewise. (insn_a_feeds_b): Likewise. (combine_instructions): Likewise. (can_combine_p): Likewise. (try_combine): Likewise. (find_split_point): Likewise. (subst): Likewise. (simplify_set): Likewise. (distribute_notes): Likewise. * cprop.c (cprop_jump): Likewise. * cse.c (cse_extended_basic_block): Likewise. * df-problems.c (can_move_insns_across): Likewise. * final.c (final): Likewise. (final_scan_insn): Likewise. * function.c (emit_use_return_register_into_block): Likewise. * gcse.c (insert_insn_end_basic_block): Likewise. * haifa-sched.c (sched_init): Likewise. * ira.c (find_moveable_pseudos): Likewise. * loop-invariant.c (find_invariant_insn): Likewise. * lra-constraints.c (curr_insn_transform): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * postreload.c (reload_combine_recognize_const_pattern): * Likewise. * reload.c (find_reloads): Likewise. (find_reloads_address_1): Likewise. * reorg.c (delete_scheduled_jump): Likewise. (steal_delay_list_from_target): Likewise. (steal_delay_list_from_fallthrough): Likewise. (try_merge_delay_insns): Likewise. (redundant_insn): Likewise. (fill_simple_delay_slots): Likewise. (fill_slots_from_thread): Likewise. (delete_computation): Likewise. (relax_delay_slots): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-rgn.c (add_branch_dependences): Likewise. From-SVN: r222296
2015-04-22 02:44:27 +02:00
#if HAVE_cc0
lambda.h (lambda_vector_min_nz): Likewise. * lambda.h (lambda_vector_min_nz): Likewise. * langhooks.h (struct lang_hooks_for_types, struct lang_hooks): Likewise. * output.h (assemble_integer, this_is_asm_operands): Likewise. * tree.h: Likewise. * vec.h: Likewise. * tree-flow-inline.h (relink_imm_use): Use gcc_assert. * optabs.c (prepare_cmp_insn, emit_cmp_and_jump_insns): Reword comments to avoid 'abort'. Use gcc_assert as necessary. * opts.c (common_handle_option): Likewise. * pretty-print.c (pp_base_format_text): Likewise. * print-rtl.c (print_rtx): Likewise. * read-rtl.c (read_rtx_filename, read_rtx_1): Likewise. * regmove.c (try_auto_increment): Likewise. * reload.c (find_valid_class, find_reloads_toplev, find_equiv_reg): Likewise. * reload1.c (reload, forget_old_reloads_1, function_invariant_p, merge_assigned_reloads): Likewise. * tree-inline.c (inline_forbidden_p_1, estimate_num_insns_1): Likewise. * tree-optimize.c (execute_todo): Likewise. * tree-outof-ssa.c (eliminate_phi): Likewise. * tree-ssa-alias.c (add_pointed_to_expr): Likewise. * tree-ssa-ccp.c (maybe_fold_stmt_indirect): Likewise. * tree-ssa-operands.c (parse_ssa_operands, get_indirect_ref_operands, create_ssa_artficial_load_stmt): Likewise. * tree-ssa-pre.c (find_or_generate_expression): Likewise. * tree-ssanames.c (release_ssa_name): Likewise. * tree.c (int_bit_position, int_byte_position, tree_low_cst, walk_tree): Likewise. * tree-ssa-operands.c (verify_abort): Fold into .. (verify_imm_links): ... here. From-SVN: r98519
2005-04-21 20:05:34 +02:00
/* Make sure if we have a canonical comparison. The RTL
documentation states that canonical comparisons are required only
for targets which have cc0. */
gcc_assert (!CONSTANT_P (x) || CONSTANT_P (y));
#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);
if (mode == VOIDmode)
mode = GET_MODE (x) != VOIDmode ? GET_MODE (x) : GET_MODE (y);
1991-12-30 04:19:53 +01:00
/* Handle all BLKmode compares. */
if (mode == BLKmode)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode result_mode;
enum insn_code cmp_code;
tree length_type;
rtx libfunc;
rtx result;
rtx opalign
= GEN_INT (MIN (MEM_ALIGN (x), MEM_ALIGN (y)) / BITS_PER_UNIT);
gcc_assert (size);
/* 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))
{
gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. From-SVN: r161810
2010-07-05 00:14:56 +02:00
cmp_code = direct_optab_handler (cmpmem_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. From-SVN: r161810
2010-07-05 00:14:56 +02:00
cmp_code = direct_optab_handler (cmpstr_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. From-SVN: r161810
2010-07-05 00:14:56 +02:00
cmp_code = direct_optab_handler (cmpstrn_optab, cmp_mode);
if (cmp_code == CODE_FOR_nothing)
continue;
/* Must make sure the size fits the insn's mode. */
if ((CONST_INT_P (size)
&& 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;
result = gen_reg_rtx (result_mode);
size = convert_to_mode (cmp_mode, size, 1);
emit_insn (GEN_FCN (cmp_code) (result, x, y, size, opalign));
*ptest = gen_rtx_fmt_ee (comparison, VOIDmode, result, const0_rtx);
*pmode = result_mode;
return;
1991-12-30 04:19:53 +01:00
}
if (methods != OPTAB_LIB && methods != OPTAB_LIB_WIDEN)
goto fail;
/* Otherwise call a library function, memcmp. */
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));
result = emit_library_call_value (libfunc, 0, LCT_PURE,
result_mode, 3,
XEXP (x, 0), Pmode,
XEXP (y, 0), Pmode,
size, cmp_mode);
x = result;
y = const0_rtx;
mode = result_mode;
methods = OPTAB_LIB_WIDEN;
unsignedp = false;
1991-12-30 04:19:53 +01:00
}
/* Don't allow operands to the compare to trap, as that can put the
compare and branch in different basic blocks. */
function.h (struct function): Add can_throw_non_call_exceptions bit. * function.h (struct function): Add can_throw_non_call_exceptions bit. * lto-streamer-in.c (input_function): Stream it in. * lto-streamer-out.c (output_function): Stream it out. * function.c (allocate_struct_function): Set it. (expand_function_end): Substitute cfun->can_throw_non_call_exceptions for flag_non_call_exceptions. * cfgbuild.c (control_flow_insn_p): Likewise. (make_edges): Likewise. * cfgexpand.c (expand_stack_alignment): Likewise. * combine.c (distribute_notes): Likewise. * cse.c (cse_extended_basic_block): Likewise. * except.c (insn_could_throw_p): Likewise. * gcse.c (simple_mem): Likewise. * ipa-pure-const.c (check_call): Likewise. (check_stmt ): Likewise. * lower-subreg.c (lower-subreg.c): Likewise. * optabs.c (emit_libcall_block): Likewise. (prepare_cmp_insn): Likewise. * postreload-gcse.c (eliminate_partially_redundant_loads): Likewise. * postreload.c (rest_of_handle_postreload): Likewise. * reload1.c (reload_as_needed): Likewise. (emit_input_reload_insns): Likewise. (emit_output_reload_insns): Likewise. (fixup_abnormal_edges): Likewise. * sel-sched-ir.c (init_global_and_expr_for_insn): Likewise. * store-motion.c (find_moveable_store): Likewise. * tree-eh.c (stmt_could_throw_p): Likewise. (tree_could_throw_p): Likewise. * tree-ssa-dce.c (mark_stmt_if_obviously_necessary): Likewise. * config/arm/arm.c (arm_expand_prologue): Likewise. (thumb1_expand_prologue): Likewise. * config/rx/rx.md (cbranchsf4): Likewise. (cmpsf): Likewise. * config/s390/s390.c (s390_emit_prologue): Likewise. * tree-inline.c (initialize_cfun): Copy can_throw_non_call_exceptions. (inline_forbidden_into_p): New predicate. (expand_call_inline): Use it to forbid inlining. (tree_can_inline_p): Likewise. From-SVN: r159847
2010-05-26 00:34:36 +02:00
if (cfun->can_throw_non_call_exceptions)
{
if (may_trap_p (x))
x = force_reg (mode, x);
if (may_trap_p (y))
y = force_reg (mode, y);
}
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
if (GET_MODE_CLASS (mode) == MODE_CC)
{
enum insn_code icode = optab_handler (cbranch_optab, CCmode);
test = gen_rtx_fmt_ee (comparison, VOIDmode, x, y);
gcc_assert (icode != CODE_FOR_nothing
&& insn_operand_matches (icode, 0, test));
*ptest = test;
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
return;
}
1991-12-30 04:19:53 +01:00
mclass = GET_MODE_CLASS (mode);
test = gen_rtx_fmt_ee (comparison, VOIDmode, x, y);
cmp_mode = mode;
do
{
enum insn_code icode;
icode = optab_handler (cbranch_optab, cmp_mode);
if (icode != CODE_FOR_nothing
&& insn_operand_matches (icode, 0, test))
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
rtx op0 = prepare_operand (icode, x, 1, mode, cmp_mode, unsignedp);
rtx op1 = prepare_operand (icode, y, 2, mode, cmp_mode, unsignedp);
if (op0 && op1
&& insn_operand_matches (icode, 1, op0)
&& insn_operand_matches (icode, 2, op1))
{
XEXP (test, 0) = op0;
XEXP (test, 1) = op1;
*ptest = test;
*pmode = cmp_mode;
return;
}
delete_insns_since (last);
}
if (methods == OPTAB_DIRECT || !CLASS_HAS_WIDER_MODES_P (mclass))
break;
cmp_mode = GET_MODE_WIDER_MODE (cmp_mode);
}
while (cmp_mode != VOIDmode);
if (methods != OPTAB_LIB_WIDEN)
goto fail;
if (!SCALAR_FLOAT_MODE_P (mode))
1991-12-30 04:19:53 +01:00
{
rtx result;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode ret_mode;
/* Handle a libcall just for the mode we are using. */
libfunc = optab_libfunc (cmp_optab, mode);
gcc_assert (libfunc);
1991-12-30 04:19:53 +01:00
/* If we want unsigned, and this mode has a distinct unsigned
comparison routine, use that. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (unsignedp)
{
rtx ulibfunc = optab_libfunc (ucmp_optab, mode);
if (ulibfunc)
libfunc = ulibfunc;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
}
1991-12-30 04:19:53 +01:00
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
ret_mode = targetm.libgcc_cmp_return_mode ();
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
ret_mode, 2, x, mode, y, mode);
/* There are two kinds of comparison routines. Biased routines
return 0/1/2, and unbiased routines return -1/0/1. Other parts
of gcc expect that the comparison operation is equivalent
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
to the modified comparison. For signed comparisons compare the
result against 1 in the biased case, and zero in the unbiased
case. For unsigned comparisons always compare against 1 after
biasing the unbiased result by adding 1. This gives us a way to
represent LTU.
The comparisons in the fixed-point helper library are always
biased. */
x = result;
y = const1_rtx;
if (!TARGET_LIB_INT_CMP_BIASED && !ALL_FIXED_POINT_MODE_P (mode))
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
{
if (unsignedp)
rtl.h (plus_constant, [...]): Merge into a single plus_constant function. gcc/ * rtl.h (plus_constant, plus_constant_mode): Merge into a single plus_constant function. * explow.c (plus_constant, plus_constant_mode): Likewise. Assert that the mode is sensible. (use_anchored_address, round_push, allocate_dynamic_stack_space) (probe_stack_range, anti_adjust_stack_and_probe): Update calls to plus_constant. * alias.c (canon_rtx): Likewise. (init_alias_analysis): Likewise. * builtins.c (expand_builtin_return_addr) (expand_builtin_setjmp_setup, expand_builtin_longjmp) (expand_builtin_nonlocal_goto, expand_builtin_update_setjmp_buf) (expand_builtin_apply_args_1, expand_builtin_apply, expand_movstr) (expand_builtin_stpcpy): Likewise. * calls.c (save_fixed_argument_area, restore_fixed_argument_area) (compute_argument_addresses, internal_arg_pointer_based_exp) (expand_call, emit_library_call_value_1): Likewise. * cfgexpand.c (expand_one_stack_var_at, expand_debug_expr): Likewise. * combine-stack-adj.c (try_apply_stack_adjustment): Likewise. * combine.c (combine_simplify_rtx, force_to_mode): Likewise. * cse.c (insert_const_anchor, find_reg_offset_for_const) (use_related_value, fold_rtx): Likewise. * cselib.c (cselib_subst_to_values): Likewise. * dse.c (record_store, check_mem_read_rtx): Likewise. * dwarf2out.c (rtl_for_decl_location, gen_variable_die): Likewise. * emit-rtl.c (adjust_address_1): Likewise. * except.c (sjlj_emit_function_enter) (expand_builtin_extract_return_addr) (expand_builtin_frob_return_addr): Likewise. * expmed.c (expand_divmod): Likewise. * expr.c (move_by_pieces, store_by_pieces, store_by_pieces_1) (emit_move_resolve_push, push_block, emit_push_insn, store_expr) (expand_expr_addr_expr_1, expand_expr_real_1): Likewise. * function.c (assign_stack_local_1) (instantiate_virtual_regs_in_rtx): Likewise. * optabs.c (prepare_cmp_insn): Likewise. * recog.c (offsettable_address_addr_space_p): Likewise. * reload.c (find_reloads_address, form_sum) (find_reloads_subreg_address): Likewise. * reload1.c (init_reload, eliminate_regs_1) (eliminate_regs_in_insn): Likewise. * simplify-rtx.c (simplify_unary_operation_1) (simplify_binary_operation_1, simplify_plus_minus): Likewise. * var-tracking.c (compute_cfa_pointer, prepare_call_arguments) (vt_add_function_parameter): Likewise. * config/alpha/alpha.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/vms.h (EH_RETURN_HANDLER_RTX): Likewise. * config/alpha/alpha.c (alpha_legitimize_address_1) (get_unaligned_address, alpha_expand_unaligned_load) (alpha_expand_unaligned_store, alpha_expand_unaligned_load_words) (alpha_expand_unaligned_store_words, alpha_expand_block_clear) (alpha_expand_builtin_establish_vms_condition_handler) (alpha_setup_incoming_varargs, emit_frame_store_1) (alpha_expand_prologue, alpha_expand_epilogue) (alpha_use_linkage): Likewise. * config/alpha/alpha.md: Likewise. * config/arm/arm.c (arm_trampoline_init, legitimize_pic_address) (arm_load_pic_register, arm_pic_static_addr, arm_legitimize_address) (thumb_legitimize_address, arm_gen_load_multiple_1) (arm_gen_store_multiple_1, arm_gen_multiple_op, gen_ldm_seq) (gen_stm_seq, gen_const_stm_seq, arm_block_move_unaligned_straight) (arm_block_move_unaligned_loop, arm_gen_movmemqi, arm_reload_in_hi) (arm_reload_out_hi, arm_reorg, vfp_emit_fstmd, emit_multi_reg_push) (emit_sfm, thumb_set_frame_pointer, arm_expand_prologue) (thumb1_emit_multi_reg_push, thumb1_expand_prologue) (thumb_expand_movmemqi, arm_set_return_address) (thumb_set_return_address): Likewise. * config/arm/arm.md: Likewise. * config/avr/avr.c (avr_incoming_return_addr_rtx) (avr_prologue_setup_frame, expand_epilogue) (avr_const_address_lo16): Likewise. * config/bfin/bfin.h (EH_RETURN_HANDLER_RTX): Likewise. * config/bfin/bfin.c (setup_incoming_varargs, bfin_load_pic_reg) (bfin_expand_prologue, bfin_trampoline_init, bfin_expand_call) (bfin_output_mi_thunk): Likewise. * config/c6x/c6x.c (c6x_initialize_trampoline) (c6x_output_mi_thunk): Likewise. * config/cr16/cr16.h (EH_RETURN_HANDLER_RTX): Likewise. * config/cr16/cr16.c (cr16_create_dwarf_for_multi_push): Likewise. * config/cris/cris.c (cris_return_addr_rtx, cris_split_movdx) (cris_expand_prologue, cris_expand_epilogue, cris_gen_movem_load) (cris_emit_movem_store, cris_trampoline_init): Likewise. * config/cris/cris.md: Likewise. * config/darwin.c (machopic_indirect_data_reference) (machopic_legitimize_pic_address): Likewise. * config/epiphany/epiphany.c (epiphany_emit_save_restore) (epiphany_expand_prologue, epiphany_expand_epilogue) (epiphany_trampoline_init): Likewise. * config/epiphany/epiphany.md: Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/frv/frv.c (frv_dwarf_store, frv_expand_prologue) (frv_expand_block_move, frv_expand_block_clear, frv_return_addr_rtx) (frv_index_memory, unspec_got_name, frv_find_base_term) (frv_output_dwarf_dtprel): Likewise. * config/h8300/h8300.c (h8300_push_pop, h8300_return_addr_rtx) (h8300_swap_into_er6, h8300_swap_out_of_er6): Likewise. * config/i386/i386.h (RETURN_ADDR_RTX): Likewise. * config/i386/i386.c (setup_incoming_varargs_64) (setup_incoming_varargs_ms_64, choose_baseaddr) (ix86_emit_save_reg_using_mov, ix86_adjust_stack_and_probe) (ix86_emit_probe_stack_range, ix86_expand_prologue) (ix86_emit_restore_reg_using_pop, ix86_emit_leave) (ix86_expand_epilogue, legitimize_pic_address, ix86_legitimize_address) (ix86_split_long_move, ix86_expand_movmem, ix86_expand_setmem) (ix86_static_chain, ix86_trampoline_init, x86_this_parameter) (x86_output_mi_thunk): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (ia64_expand_load_address) (ia64_expand_tls_address, ia64_expand_move, ia64_split_tmode) (do_spill, ia64_trampoline_init): Likewise. * config/iq2000/iq2000.c (iq2000_va_start) (iq2000_emit_frame_related_store, iq2000_expand_prologue) (iq2000_expand_eh_return, iq2000_setup_incoming_varargs) (iq2000_print_operand, iq2000_legitimize_address): Likewise. * config/lm32/lm32.c (lm32_setup_incoming_varargs): Likewise. * config/m32c/m32c.c (m32c_return_addr_rtx) (m32c_expand_insv): Likewise. * config/m32r/m32r.c (m32r_setup_incoming_varargs) (m32r_legitimize_pic_address, m32r_print_operand) (m32r_print_operand_address): Likewise. * config/m68k/linux.h (FINALIZE_TRAMPOLINE): Likewise. * config/m68k/m68k.h (RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/m68k/m68k.c (m68k_emit_movem, m68k_expand_prologue) (m68k_expand_epilogue, legitimize_pic_address) (m68k_output_mi_thunk): Likewise. * config/m68k/m68k.md: Likewise. * config/mcore/mcore.c (mcore_expand_prolog): Likewise. (mcore_expand_epilog): Likewise. * config/mcore/mcore.md: Likewise. * config/mep/mep.c (mep_allocate_initial_value) (mep_expand_prologue, mep_expand_epilogue): Likewise. * config/microblaze/microblaze.c (double_memory_operand) (microblaze_block_move_loop): Likewise. * config/mips/mips.c (mips_strip_unspec_address, mips_add_offset) (mips_setup_incoming_varargs, mips_va_start, mips_block_move_loop) (mips_print_operand, mips16e_save_restore_reg, mips_save_restore_reg) (mips_expand_prologue, mips_epilogue_set_cfa) (mips_expand_epilogue): Likewise. * config/mips/mips.md: Likewise. * config/mmix/mmix.c (mmix_dynamic_chain_address, mmix_return_addr_rtx) (mmix_expand_prologue, mmix_expand_epilogue): Likewise. * config/mn10300/mn10300.c (mn10300_gen_multiple_store) (mn10300_builtin_saveregs, mn10300_trampoline_init): Likewise. * config/moxie/moxie.h (INCOMING_RETURN_ADDR_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/moxie/moxie.c (moxie_static_chain): Likewise. * config/pa/pa.c (legitimize_pic_address, hppa_legitimize_address) (store_reg, set_reg_plus_d, pa_expand_prologue, load_reg) (pa_return_addr_rtx, hppa_builtin_saveregs) (pa_trampoline_init): Likewise. * config/pa/pa.md: Likewise. * config/pdp11/pdp11.c (pdp11_expand_epilogue): Likewise. * config/picochip/picochip.c (picochip_static_chain): Likewise. * config/rs6000/rs6000.h (RS6000_SAVE_TOC): Likewise. * config/rs6000/rs6000.c (rs6000_legitimize_address) (setup_incoming_varargs, print_operand, rs6000_return_addr) (rs6000_emit_eh_reg_restore, rs6000_emit_probe_stack_range) (rs6000_emit_epilogue) (rs6000_machopic_legitimize_pic_address): Likewise. * config/rx/rx.c (gen_rx_rtsd_vector, gen_rx_popm_vector): Likewise. * config/s390/s390.h (INITIAL_FRAME_ADDRESS_RTX): Likewise. (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/s390/s390.c (s390_decompose_address, legitimize_pic_address) (s390_delegitimize_address, print_operand, annotate_constant_pool_refs) (replace_constant_pool_ref, s390_return_addr_rtx, s390_back_chain_rtx) (save_fpr, restore_fpr, save_gprs, restore_gprs, s390_emit_prologue) (s390_emit_epilogue, s390_function_profiler): Likewise. * config/s390/s390.md: Likewise. * config/score/score.c (score_add_offset, score_prologue): Likewise. * config/sh/sh.c (expand_block_move, push_regs, sh_builtin_saveregs) (sh_output_mi_thunk): Likewise. * config/sh/sh.md: Likewise. * config/sparc/sparc.h (DYNAMIC_CHAIN_ADDRESS, FRAME_ADDR_RTX) (RETURN_ADDR_RTX, INCOMING_RETURN_ADDR_RTX): Likewise. * config/sparc/sparc.c (sparc_legitimize_pic_address) (sparc_emit_probe_stack_range, emit_save_or_restore_regs) (emit_window_save, sparc_flat_expand_prologue, sparc_struct_value_rtx) (emit_and_preserve): Likewise. * config/sparc/sparc.md: Likewise. * config/spu/spu.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/spu/spu.c (spu_expand_insv, spu_machine_dependent_reorg) (spu_setup_incoming_varargs, ea_load_store_inline) (spu_expand_load): Likewise. * config/stormy16/stormy16.c (xstormy16_expand_prologue) (combine_bnp): Likewise. * config/tilegx/tilegx.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilegx/tilegx.c (tilegx_setup_incoming_varargs) (tilegx_expand_unaligned_load, tilegx_trampoline_init): Likewise. * config/tilepro/tilepro.h (DYNAMIC_CHAIN_ADDRESS): Likewise. * config/tilepro/tilepro.c (tilepro_setup_incoming_varargs) (tilepro_expand_unaligned_load, tilepro_trampoline_init): Likewise. * config/v850/v850.c (expand_prologue, expand_epilogue): Likewise. * config/v850/v850.md: Likewise. * config/vax/elf.h (EH_RETURN_STACKADJ_RTX): Likewise. (EH_RETURN_HANDLER_RTX): Likewise. * config/vax/vax.h (DYNAMIC_CHAIN_ADDRESS, RETURN_ADDR_RTX): Likewise. * config/vax/vax.c (vax_add_reg_cfa_offset, vax_expand_prologue) (print_operand_address, vax_trampoline_init): Likewise. * config/xtensa/xtensa.c (xtensa_expand_prologue, xtensa_return_addr) (xtensa_function_value_regno_p): Likewise. From-SVN: r187199
2012-05-05 19:41:49 +02:00
x = plus_constant (ret_mode, result, 1);
else
y = const0_rtx;
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
}
*pmode = ret_mode;
prepare_cmp_insn (x, y, comparison, NULL_RTX, unsignedp, methods,
ptest, pmode);
1991-12-30 04:19:53 +01:00
}
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
else
prepare_float_lib_cmp (x, y, comparison, ptest, pmode);
1991-12-30 04:19:53 +01:00
return;
fail:
*ptest = NULL_RTX;
1991-12-30 04:19:53 +01: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
WIDER_MODE (UNSIGNEDP determines whether it is an unsigned conversion), and
that it is accepted by the operand predicate. Return the new value. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
prepare_operand (enum insn_code icode, rtx x, int opnum, machine_mode mode,
machine_mode wider_mode, int unsignedp)
{
if (mode != wider_mode)
x = convert_modes (wider_mode, mode, x, unsignedp);
if (!insn_operand_matches (icode, opnum, x))
{
machine_mode op_mode = insn_data[(int) icode].operand[opnum].mode;
if (reload_completed)
return NULL_RTX;
if (GET_MODE (x) != op_mode && GET_MODE (x) != VOIDmode)
return NULL_RTX;
x = copy_to_mode_reg (op_mode, x);
}
return x;
}
/* Subroutine of emit_cmp_and_jump_insns; this function is called when we know
we can do the branch. */
static void
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
emit_cmp_and_jump_insn_1 (rtx test, machine_mode mode, rtx label, int prob)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode optab_mode;
enum mode_class mclass;
enum insn_code icode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insn;
mclass = GET_MODE_CLASS (mode);
optab_mode = (mclass == MODE_CC) ? CCmode : mode;
icode = optab_handler (cbranch_optab, optab_mode);
Revert 2004-09-09 Giovanni Bajo <giovannibajo@gcc.gnu.org> * lambda-mat.c (lambda_matrix_inverse_hard): Use gcc_assert and gcc_unreachable instead of abort. * lambda.h (lambda_vector_min_nz): Likewise. * langhooks.c lhd_set_decl_assembler_name, lhd_can_use_bit_fields_p, lhd_incomplete_type_error, lhd_expand_expr, lhd_types_compatible_p, lhd_gimplify_expr): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (update_equiv_regs, block_alloc, find_free_reg): Likewise. * loop-doloop.c (doloop_modify): Likewise. * loop-invariant.c (record_use): Likewise. * loop-iv.c (get_biv_step_1, get_biv_step, iv_analyze, get_iv_value, canon_condition, simplify_using_condition, simplify_using_initial_values, shorten_into_mode, canonicalize_iv_subregs, iv_number_of_iterations): Likewise. * loop-unroll.c (unroll_and_peel_loops, peel_loop_completely, unroll_loop_constant_iterations, unroll_loop_runtime_iterations, peel_loop_simple, unroll_loop_stupid): Likewise. * loop-unswitch.c (compare_and_jump_seq, unswitch_single_loop, unswitch_loop): Likewise. * loop.c (gen_prefetch, loop_optimize, rtx_equal_for_loop_p, move_movables, replace_call_address, find_and_verify_loops, rtx_equal_for_prefetch_p, record_giv, general_induction_var, simplify_giv_expr, check_ext_dependent_givs, try_copy_prop, loop_giv_dump): Likewise. * loop.h (INSN_LUID): Likewise. * modulo-sched.c (normalize_sched_times, generate_prolog_epilog, sms_schedule, check_nodes_order): Likewise. * optabs.c (gen_conditional, add_equal_note, expand_simple_binop, expand_twoval_unop, expand_twoval_binop, expand_twoval_binop_libfunc, expand_simple_unop, emit_no_conflict_block, prepare_cmp_insn, emit_cmp_and_jump_insn_1, emit_cmp_and_jump_insns, prepare_float_lib_cmp, gen_add2_insn, have_add2_insn, gen_sub2_insn, have_sub2_insn, expand_float, expand_fix, debug_optab_libfuncs): Likewise. * opts.c (common_handle_option): Likewise. * params.c (set_param_value): Likewise. * passes.c (open_dump_file, rest_of_handle_final): Likewise. * postreload-gcse.c (expr_equiv_p, oprs_unchanged_p,hash_scan_set, reg_set_between_after_reload_p, reg_used_between_after_reload_p, get_avail_load_store_reg, eliminate_partially_redundant_load): Likewise. * postreload.c (reload_cse_simplify_set, reload_combine_note_use): Likewise. * predict.c (tree_predicted_by_p, expected_value_to_br_prob, propagate_freq, expensive_function_p): Likewise. * pretty-print.c (pp_base_format_text) * profile.c (instrument_edges, instrument_values, compute_branch_probabilities, branch_prob, union_groups, end_branch_prob, tree_register_profile_hooks): Likewise. From-SVN: r87290
2004-09-10 13:02:26 +02:00
gcc_assert (icode != CODE_FOR_nothing);
gcc_assert (insn_operand_matches (icode, 0, test));
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
insn = emit_jump_insn (GEN_FCN (icode) (test, XEXP (test, 0),
XEXP (test, 1), label));
if (prob != -1
&& profile_status_for_fn (cfun) != PROFILE_ABSENT
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
&& insn
&& JUMP_P (insn)
&& any_condjump_p (insn)
&& !find_reg_note (insn, REG_BR_PROB, 0))
rtl.texi (REG_NOTES): Say that int_list can also be used. gcc/ * doc/rtl.texi (REG_NOTES): Say that int_list can also be used. (REG_BR_PROB): Say that the probability is stored in an int_list. * reg-notes.def: Update commentary to mention INT_LIST. * rtl.def (EXPR_LIST, INSN_LIST): Capitalize comments. (INT_LIST): New rtx. * rtl.h (add_int_reg_note, add_shallow_copy_of_reg_note): Declare. * rtlanal.c (int_reg_note_p): New function. (alloc_reg_note): Assert that the note does not have an int argument. (add_int_reg_note, add_shallow_copy_of_reg_note): New functions. * combine.c (distribute_notes): Use add_shallow_copy_of_rtx. * cse.c (cse_process_notes_1): Expect REG_EQUAL to be an EXPR_LIST rather than an INSN_LIST. Handle INT_LIST. * ifcvt.c (cond_exec_process_insns): Take the probability as an int rather than an rtx. Use gen_rtx_INT_LIST to create a REG_BR_PROB note. (cond_exec_process_if_block): Use XINT to extract REG_BR_PROB values. Manipulate them as ints rather than rtxes. * reg-stack.c (subst_asm_stack_regs): Only handle EXPR_LIST notes. * regmove.c (copy_src_to_dest): Likewise. * sched-vis.c (print_insn_with_notes): Handle INT_LIST. * config/i386/winnt.c (i386_pe_seh_unwind_emit): Sink pat assignment into the cases that need it. * config/arm/arm.c (arm_unwind_emit): Likewise. * asan.c (asan_clear_shadow): Use add_int_reg_note for REG_BR_PROB. * emit-rtl.c (try_split, emit_copy_of_insn_after): Likewise. * loop-doloop.c (add_test, doloop_modify): Likewise. * loop-unswitch.c (compare_and_jump_seq): Likewise. * optabs.c (emit_cmp_and_jump_insn_1): Likewise. * predict.c (combine_predictions_for_insn): Likewise. * print-rtl.c (print_rtx): Handle INT_LIST. * config/aarch64/aarch64.c (aarch64_emit_unlikely_jump): Likewise. * config/alpha/alpha.c (emit_unlikely_jump): Likewise. * config/arm/arm.c (emit_unlikely_jump): Likewise. * config/i386/i386.c (ix86_expand_split_stack_prologue): Likewise. (ix86_split_fp_branch, predict_jump): Likewise. * config/rs6000/rs6000.c (emit_unlikely_jump): Likewise. * config/sh/sh.c (expand_cbranchsi4): Likewise. * config/spu/spu.c (ea_load_store_inline): Likewise. * cfgbuild.c (compute_outgoing_frequencies): Use XINT to access the value of a REG_BR_PROB note. * cfgrtl.c (force_nonfallthru_and_redirect): Likewise. (update_br_prob_note, rtl_verify_edges, purge_dead_edges): Likewise. * emit-rtl.c (try_split): Likewise. * predict.c (br_prob_note_reliable_p): Likewise. (invert_br_probabilities, combine_predictions_for_insn): Likewise. * reorg.c (mostly_true_jump): Likewise. * config/bfin/bfin.c (cbranch_predicted_taken_p): Likewise. * config/frv/frv.c (frv_print_operand_jump_hint): Likewise. * config/i386/i386.c (ix86_print_operand): Likewise. * config/ia64/ia64.c (ia64_print_operand): Likewise. * config/mmix/mmix.c (mmix_print_operand): Likewise. * config/rs6000/rs6000.c (output_cbranch): Likewise. * config/s390/s390.c (s390_expand_tbegin): Likewise. * config/sh/sh.c (sh_print_operand, sh_adjust_cost): Likewise. * config/sparc/sparc.c (output_cbranch): Likewise. * config/spu/spu.c (get_branch_target): Likewise. * config/tilegx/tilegx.c (cbranch_predicted_p): Likewise. * config/tilepro/tilepro.c (cbranch_predicted_p): Likewise. From-SVN: r202839
2013-09-23 19:41:02 +02:00
add_int_reg_note (insn, REG_BR_PROB, prob);
}
/* 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.
UNSIGNEDP nonzero says that X and Y are unsigned; this matters if they
need to be widened. UNSIGNEDP is also used to select the proper
branch condition code.
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
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.
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 potentially converted into an unsigned variant based on
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
UNSIGNEDP to select a proper jump instruction.
PROB is the probability of jumping to LABEL. */
void
emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode, int unsignedp, rtx label,
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
int prob)
{
rtx op0 = x, op1 = y;
rtx test;
/* Swap operands and condition to ensure canonical RTL. */
if (swap_commutative_operands_p (x, y)
&& can_compare_p (swap_condition (comparison), mode, ccp_jump))
{
op0 = y, op1 = x;
comparison = swap_condition (comparison);
}
/* If OP0 is still a constant, then both X and Y must be constants
or the opposite comparison is not supported. Force X into a register
to create canonical RTL. */
if (CONSTANT_P (op0))
op0 = force_reg (mode, op0);
if (unsignedp)
comparison = unsigned_condition (comparison);
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
2001-11-16 00:44:58 +01:00
prepare_cmp_insn (op0, op1, comparison, size, unsignedp, OPTAB_LIB_WIDEN,
&test, &mode);
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
emit_cmp_and_jump_insn_1 (test, mode, label, prob);
}
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.). */
static void
prepare_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
rtx *ptest, machine_mode *pmode)
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
enum rtx_code swapped = swap_condition (comparison);
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
enum rtx_code reversed = reverse_condition_maybe_unordered (comparison);
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode orig_mode = GET_MODE (x);
machine_mode mode, cmp_mode;
rtx true_rtx, false_rtx;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx value, target, equiv;
rtx_insn *insns;
rtx libfunc = 0;
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
bool reversed_p = false;
cmp_mode = targetm.libgcc_cmp_return_mode ();
1991-12-30 04:19:53 +01:00
for (mode = orig_mode;
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
1991-12-30 04:19:53 +01:00
{
if (code_to_optab (comparison)
&& (libfunc = optab_libfunc (code_to_optab (comparison), 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
break;
1991-12-30 04:19:53 +01:00
if (code_to_optab (swapped)
&& (libfunc = optab_libfunc (code_to_optab (swapped), mode)))
1991-12-30 04:19:53 +01:00
{
Use std::swap instead of manual swaps. gcc/ * auto-inc-dec.c (reverse_mem, reverse_inc): Remove. (parse_add_or_inc): Use std::swap instead of reverse_{mem,inc}. (find_inc): Likewise. * combine.c (combine_simplify_rtx): Use std::swap instead of manually swapping. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * df-scan.c (df_swap_refs): Remove. (df_sort_and_compress_refs): Use std::swap instead of df_swap_refs. * dominance.c (link_roots): Use std::swap instead of manually swapping. * expr.c (expand_expr_real_2, do_store_flag): Likewise. * fold-const.c (fold_relational_const): Likewise. * genattrtab.c (simplify_test_exp): Likewise. * gimple-match-head.c (gimple_resimplify2, gimple_resimplify3, gimple_simplify): Likewise. * ifcvt.c (noce_try_abs, find_if_header): Likewise. * internal-fn.c (expand_addsub_overflow, expand_mul_overflow): Likewise. * ipa-devirt.c (add_type_duplicate): Likewise. * loop-iv.c (get_biv_step_1, iv_number_of_iterations): Likewise. * lra-lives.c (lra_setup_reload_pseudo_preferenced_hard_reg): Likewise. * lra.c (lra_create_copy): Likewise. * lto-streamer-out.c (DFS::DFS): Likewise. * modulo-sched.c (get_sched_window): Likewise. * omega.c (omega_pretty_print_problem): Likewise. * optabs.c (prepare_float_lib_cmp, expand_mult_highpart): Likewise. * reload1.c (reloads_unique_chain_p): Likewise. * sel-sched-ir.c (exchange_lv_sets, exchange_av_sets): Remove. (exchange_data_sets): Move logic from exchange_{av,lv}_sets here and use std::swap. * simplify-rtx.c (simplify_unary_operation_1): Use std::swap instead of manually swapping. * tree-if-conv.c (is_cond_scalar_reduction, predicate_scalar_phi, predicate_mem_writes): Likewise. * tree-loop-distribution.c (pg_add_dependence_edges): Likewise. * tree-predcom.c (combine_chains): Likewise. * tree-ssa-alias.c (nonoverlapping_component_refs_p, refs_may_alias_p_1): Likewise. * tree-ssa-ifcombine.c (recognize_if_then_else): Likewise. * tree-ssa-loop-ivopts.c (extract_cond_operands): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard, number_of_iterations_cond): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise. * tree-vect-slp.c (vect_build_slp_tree): Likewise. * tree-vect-stmts.c (supportable_widening_operation): Likewise. * tree-vrp.c (extract_range_from_binary_expr_1, extract_range_from_unary_expr_1): Likewise. gcc/cp/ * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of manually swapping. * semantics.c (finish_omp_atomic): Likewise. * typeck.c (cp_build_array_ref): Likewise. gcc/c-family/ * c-common.c (scalar_to_vector): Use std::swap instead of manually swapping. From-SVN: r224718
2015-06-22 04:54:11 +02:00
std::swap (x, y);
* 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
comparison = swapped;
break;
1991-12-30 04:19:53 +01:00
}
if (code_to_optab (reversed)
&& (libfunc = optab_libfunc (code_to_optab (reversed), mode)))
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
{
comparison = reversed;
reversed_p = true;
break;
}
}
gcc_assert (mode != VOIDmode);
* 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);
}
/* 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
|| FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
{
true_rtx = const_true_rtx;
false_rtx = const0_rtx;
}
else
{
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:
gcc_unreachable ();
}
}
if (comparison == UNORDERED)
{
rtx temp = simplify_gen_relational (NE, cmp_mode, mode, x, x);
equiv = simplify_gen_relational (NE, cmp_mode, mode, y, y);
equiv = simplify_gen_ternary (IF_THEN_ELSE, cmp_mode, cmp_mode,
temp, const_true_rtx, equiv);
}
else
{
equiv = simplify_gen_relational (comparison, cmp_mode, mode, x, y);
if (! FLOAT_LIB_COMPARE_RETURNS_BOOL (mode, comparison))
equiv = simplify_gen_ternary (IF_THEN_ELSE, cmp_mode, cmp_mode,
equiv, true_rtx, false_rtx);
}
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
cmp_mode, 2, x, mode, y, mode);
insns = get_insns ();
end_sequence ();
target = gen_reg_rtx (cmp_mode);
emit_libcall_block (insns, target, value, equiv);
* 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)
|| reversed_p)
*ptest = gen_rtx_fmt_ee (reversed_p ? EQ : NE, VOIDmode, target, false_rtx);
else
*ptest = gen_rtx_fmt_ee (comparison, VOIDmode, target, const0_rtx);
* 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
*pmode = cmp_mode;
1991-12-30 04:19:53 +01:00
}
/* Generate code to indirectly jump to a location given in the rtx LOC. */
void
emit_indirect_jump (rtx loc ATTRIBUTE_UNUSED)
1991-12-30 04:19:53 +01:00
{
#ifndef HAVE_indirect_jump
sorry ("indirect jumps are not available on this target");
#else
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[1];
create_address_operand (&ops[0], loc);
expand_jump_insn (CODE_FOR_indirect_jump, 1, ops);
emit_barrier ();
#endif
1991-12-30 04:19:53 +01:00
}
/* 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
emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode cmode, rtx op2, rtx op3,
machine_mode mode, int unsignedp)
{
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
rtx comparison;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last;
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))
{
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (op0, op1);
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. */
if (code == LT && op1 == const1_rtx)
code = LE, op1 = const0_rtx;
else if (code == GT && op1 == constm1_rtx)
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))
{
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (op2, op3);
code = reversed;
}
if (mode == VOIDmode)
mode = GET_MODE (op2);
gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. From-SVN: r161810
2010-07-05 00:14:56 +02:00
icode = direct_optab_handler (movcc_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!target)
target = gen_reg_rtx (mode);
code = unsignedp ? unsigned_condition (code) : code;
comparison = simplify_gen_relational (code, VOIDmode, cmode, op0, op1);
/* 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 (!COMPARISON_P (comparison))
return NULL_RTX;
saved_pending_stack_adjust save;
save_pending_stack_adjust (&save);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
last = get_last_insn ();
do_pending_stack_adjust ();
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp, OPTAB_WIDEN,
&comparison, &cmode);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (comparison)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[4];
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, mode);
create_fixed_operand (&ops[1], comparison);
create_input_operand (&ops[2], op2, mode);
create_input_operand (&ops[3], op3, mode);
if (maybe_expand_insn (icode, 4, ops))
{
if (ops[0].value != target)
convert_move (target, ops[0].value, false);
return target;
}
}
delete_insns_since (last);
restore_pending_stack_adjust (&save);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
return NULL_RTX;
}
/* Return nonzero if a conditional move of mode MODE is supported.
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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_conditionally_move_p (machine_mode mode)
{
gcc/ * optabs.h (reload_in_optab, reload_out_optab, code_to_optab) (vcond_gen_code, vcondu_gen_code, movmem_optab, setmem_optab) (cmpstr_optab, cmpstrn_optab, cmpmem_optab, sync_add_optab) (sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab) (sync_nand_optab, sync_old_add_optab, sync_old_sub_optab) (sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab) (sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab) (sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab) (sync_new_nand_optab): Redefine as macros. (sync_compare_and_swap, sync_lock_test_and_set, sync_lock_release): Delete. (direct_optab_index): New enum. (direct_optab_d): New structure. (direct_optab): New typedef. (direct_optab_table): Declare. (direct_optab_handler, set_direct_optab_handler): New functions. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab) (sync_lock_release_optab): New macros. * optabs.c (direct_optab_table): New variable. (movcc_gen_code, vcond_gen_code, vcondu_gen_code): Delete. (prepare_cmp_insn): Use direct_optab_handler for cmpmem_optab, cmpstr_optab and cmpstrn_optab. (emit_conditional_move): Likewise for movcc_optab. (can_conditionally_move_p): Likewise for movcc_gen_code. (init_insn_codes): Clear direct_optab_table. (init_optabs): Don't initialize the new "direct optabs" here. (get_vcond_icode): Use direct_optab_handler for vcondu_gen_code and vcond_gen_code. (expand_val_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_bool_compare_and_swap): Likewise sync_compare_and_swap_optab. (expand_compare_and_swap_loop): Likewise sync_compare_and_swap_optab. (expand_sync_operation): Likewise other sync_*_optabs. (expand_sync_fetch_operation): Likewise. Rename sync_compare_and_swap to sync_compare_and_swap_optab. (expand_sync_lock_test_and_set): Use direct_optab_handler for sync_lock_test_and_set and sync_compare_and_swap, adding "_optab" to the names of both. * builtins.c (expand_builtin_strcmp): Use direct_optab_handler for cmpstr_optab and cmpstrn_optab. (expand_builtin_lock_release): Likewise sync_lock_release. * expr.c (movmem_optab, setmem_optab, cmpstr_optab, cmpstrn_optab) (cmpmem_optab, sync_add_optab, sync_sub_optab, sync_ior_optab) (sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab) (sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab) (sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab) (sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab) (sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap) (sync_lock_test_and_set, sync_lock_release): Delete. (emit_block_move_via_movmem): Use direct_optab_handler for movmem_optab. (emit_block_move_via_setmem): Use direct_optab_handler for setmem_optab. * genopinit.c (optabs): Use set_direct_optab_handler for the new macro optabs. * omp-low.c (expand_omp_atomic_fetch_op): Update the type of the "optab" local variable. Use direct_optab_handler for optab and sync_compare_and_swap_optab. * reload1.c (reload_in_optab, reload_out_optab): Delete. * targhooks.c (default_secondary_reload): Use direct_optab_handler for reload_in_optab and reload_out_optab. * config/alpha/alpha.c (alpha_secondary_reload): Likewise. * config/frv/frv.c (frv_alloc_temp_reg): Likewise. * config/pa/pa.c (pa_secondary_reload): Likewise. * java/builtins.c (compareAndSwapInt_builtin): Use direct_optab_handler for sync_compare_and_swap, renaming it to sync_compare_and_swap_optab. (compareAndSwapLong_builtin, compareAndSwapObject_builtin): Likewise. (VMSupportsCS8_builtin): Likewise. From-SVN: r161810
2010-07-05 00:14:56 +02:00
if (direct_optab_handler (movcc_optab, mode) != CODE_FOR_nothing)
return 1;
return 0;
}
/* 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 false, 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
emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode cmode, rtx op2, rtx op3,
machine_mode mode, int unsignedp)
{
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
rtx comparison;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last;
enum insn_code icode;
/* 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))
{
Use std::swap instead of explicit swaps gcc/ * bb-reorder.c (fix_up_fall_thru_edges): Use std::swap instead of explicit swaps. * dojump.c (do_compare_rtx_and_jump): Likewise. * expmed.c (emit_store_flag_1): Likewise. * fibonacci_heap.h (fibonacci_heap::union_with): Likewise. * final.c (sprint_ul): Use std::reverse for reversing a string. * fold-const.c (extract_muldiv_1): Use std::swap. * genmodes.c (emit_mode_int_n): Likewise. * ifcvt.c (dead_or_predicable): Likewise. * ira-build.c (ira_merge_live_ranges): Likewise. (swap_allocno_copy_ends_if_necessary): Likewise. * ira.c (ira_setup_alts): Likewise. * loop-iv.c (iv_analyze_expr): Likewise. (implies_p): Likewise. (canon_condition): Likewise. * lra-constraints.c (swap_operands): Likewise. * lra-lives.c (lra_merge_live_ranges): Likewise. * omega.c (swap): Remove. (bswap): Remove. (omega_unprotect_1): Use std::swap. (omega_solve_geq): Likewise. * optabs.c (expand_binop_directly): Likewise. (expand_binop): Likewise. (emit_conditional_move): Likewise. (emit_conditional_add): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * reg-stack.c (emit_swap_insn): Likewise. (swap_to_top): Likewise. (compare_for_stack_reg): Likewise. (subst_asm_stack_regs): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (gen_reload_chain_without_interm_reg_p): Likewise. * sel-sched.c (invoke_reorder_hooks): Likewise. (create_block_for_bookkeeping): Likewise. * tree-data-ref.c (lambda_matrix_row_exchange): Remove. (lambda_matrix_right_hermite): Use std::swap. * tree-ssa-coalesce.c (sort_coalesce_list): Likewise. * tree-ssa-ifcombine.c (ifcombine_ifandif): Likewise. * tree-ssa-loop-ivopts.c (iv_ca_delta_reverse): Likewise. * tree-ssa-math-opts.c (is_widening_mult_p): Likewise. * tree-ssa-phiopt.c (hoist_adjacent_loads): Likewise. * tree-ssa-reassoc.c (linearize_expr_tree): Likewise. * tree-ssa-threadedge.c (simplify_control_stmt_condition): Likewise. * tree-vrp.c (compare_ranges): Likewise. * var-tracking.c (add_with_sets): Likewise. (vt_find_locations): Likewise. gcc/c/ * c-typeck.c (build_array_ref): Use std::swap instead of explicit swaps gcc/cp/ * typeck.c (composite_pointer_type): Use std::swap instead of explicit swaps. gcc/c-family/ * c-common.c (shorten_compare): Use std::swap instead of explicit swaps. gcc/fortran/ * interface.c (compare_actual_formal): Use std::swap instead of explicit swaps. * trans-array.c (gfc_trans_scalarized_loop_end): Likewise. * trans-intrinsic.c (walk_inline_intrinsic_transpose): Likewise. From-SVN: r223332
2015-05-19 06:24:31 +02:00
std::swap (op0, op1);
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. */
if (code == LT && op1 == const1_rtx)
code = LE, op1 = const0_rtx;
else if (code == GT && op1 == constm1_rtx)
code = GE, op1 = const0_rtx;
if (cmode == VOIDmode)
cmode = GET_MODE (op0);
if (mode == VOIDmode)
mode = GET_MODE (op2);
icode = optab_handler (addcc_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
if (!target)
target = gen_reg_rtx (mode);
code = unsignedp ? unsigned_condition (code) : code;
comparison = simplify_gen_relational (code, VOIDmode, cmode, op0, op1);
/* 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 (!COMPARISON_P (comparison))
return NULL_RTX;
do_pending_stack_adjust ();
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
last = get_last_insn ();
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp, OPTAB_WIDEN,
&comparison, &cmode);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (comparison)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[4];
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, mode);
create_fixed_operand (&ops[1], comparison);
create_input_operand (&ops[2], op2, mode);
create_input_operand (&ops[3], op3, mode);
if (maybe_expand_insn (icode, 4, ops))
{
if (ops[0].value != target)
convert_move (target, ops[0].value, false);
return target;
}
}
delete_insns_since (last);
return NULL_RTX;
}
/* These functions attempt to generate an insn body, rather than
emitting the insn, but if the gen function already emits them, we
expr.c (enqueue_insn, [...]): Remove. 2004-07-14 Paolo Bonzini <bonzini@gnu.org> * expr.c (enqueue_insn, finish_expr_for_function, protect_from_queue, queued_subexp_p, mark_queue, emit_insns_enqueued_after_mark, emit_queue, expand_increment): Remove. (store_constructor): Expand increment as an assignment. (expand_expr_real_1 <case PREINCREMENT_EXPR, case PREDECREMENT_EXPR, case POSTINCREMENT_EXPR, case POSTDECREMENT_EXPR>): Abort. * expr.h (QUEUED_VAR, QUEUED_INSN, QUEUED_COPY, QUEUED_BODY, QUEUED_NEXT, finish_expr_for_function, protect_from_queue, emit_queue, queued_subexp_p): Remove. * function.h (pending_chain, x_pending_chain): Remove. * rtl.def (QUEUED): Remove. * emit-rtl.c (copy_insn_1, copy_most_rtx, set_used_flags, verify_rtx_sharing): Remove references to QUEUED. * genattrtab.c (attr_copy_rtx, clear_struct_flag, encode_units_mask): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. * rtl.c (copy_rtx): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p): Likewise. * simplify-rtx.c (simplify_gen_subreg): Likewise. * config/mn10300/mn10300.c (legitimate_pic_operand_p): Likewise. * builtins.c (expand_builtin, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_mathfn_2, expand_builtin_mathfn_3, expand_builtin_setjmp_setup): Remove calls to emit_queue and protect_from_queue. * calls.c (expand_call, precompute_arguments, precompute_register_parameters, rtx_for_function_call, store_one_arg): Likewise. * dojump.c (do_compare_and_jump, do_jump): Likewise. * explow.c (memory_address): Likewise. * expmed.c (clear_by_pieces_1, clear_storage, clear_storage_via_libcall, emit_group_load, emit_group_store, emit_store_flag, expand_expr_real_1, store_by_pieces, store_constructor, store_expr, try_casesi, try_tablejump): Likewise. * function.c (expand_pending_sizes): Likewise. * optabs.c (emit_cmp_and_jump_insns, emit_conditional_add, emit_conditional_move, expand_fix, expand_float, prepare_cmp_insn): Likewise. * stmt.c (emit_case_bit_tests, expand_asm_expr, expand_computed_goto, expand_decl_init, expand_end_case_type, expand_end_stmt_expr, expand_expr_stmt_value, expand_return, expand_start_case, optimize_tail_recursion): Likewise. * config/c4x/c4x.c (c4x_expand_builtin): Likewise. * config/s390/s390.c (s390_expand_cmpmem): Likewise. From-SVN: r84675
2004-07-14 09:30:23 +02:00
make no attempt to turn them back into naked patterns. */
1991-12-30 04:19:53 +01:00
/* Generate and return an insn body to add Y to X. */
rtx_insn *
gen_add2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode = optab_handler (add_optab, GET_MODE (x));
1991-12-30 04:19:53 +01:00
gcc_assert (insn_operand_matches (icode, 0, x));
gcc_assert (insn_operand_matches (icode, 1, x));
gcc_assert (insn_operand_matches (icode, 2, y));
1991-12-30 04:19:53 +01:00
return GEN_FCN (icode) (x, x, y);
1991-12-30 04:19:53 +01:00
}
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. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx_insn *
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
{
enum insn_code icode = optab_handler (add_optab, GET_MODE (r0));
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
if (icode == CODE_FOR_nothing
|| !insn_operand_matches (icode, 0, r0)
|| !insn_operand_matches (icode, 1, r1)
|| !insn_operand_matches (icode, 2, c))
return NULL;
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
return GEN_FCN (icode) (r0, r1, 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
}
1991-12-30 04:19:53 +01:00
int
have_add2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode;
gcc_assert (GET_MODE (x) != VOIDmode);
icode = optab_handler (add_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
if (!insn_operand_matches (icode, 0, x)
|| !insn_operand_matches (icode, 1, x)
|| !insn_operand_matches (icode, 2, y))
return 0;
return 1;
1991-12-30 04:19:53 +01:00
}
/* Generate and return an insn body to add Y to X. */
rtx_insn *
gen_addptr3_insn (rtx x, rtx y, rtx z)
{
enum insn_code icode = optab_handler (addptr3_optab, GET_MODE (x));
gcc_assert (insn_operand_matches (icode, 0, x));
gcc_assert (insn_operand_matches (icode, 1, y));
gcc_assert (insn_operand_matches (icode, 2, z));
return GEN_FCN (icode) (x, y, z);
}
/* Return true if the target implements an addptr pattern and X, Y,
and Z are valid for the pattern predicates. */
int
have_addptr3_insn (rtx x, rtx y, rtx z)
{
enum insn_code icode;
gcc_assert (GET_MODE (x) != VOIDmode);
icode = optab_handler (addptr3_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
if (!insn_operand_matches (icode, 0, x)
|| !insn_operand_matches (icode, 1, y)
|| !insn_operand_matches (icode, 2, z))
return 0;
return 1;
}
1991-12-30 04:19:53 +01:00
/* Generate and return an insn body to subtract Y from X. */
rtx_insn *
gen_sub2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode = optab_handler (sub_optab, GET_MODE (x));
1991-12-30 04:19:53 +01:00
gcc_assert (insn_operand_matches (icode, 0, x));
gcc_assert (insn_operand_matches (icode, 1, x));
gcc_assert (insn_operand_matches (icode, 2, y));
1991-12-30 04:19:53 +01:00
return GEN_FCN (icode) (x, x, y);
1991-12-30 04:19:53 +01:00
}
/* Generate and return an insn body to subtract r1 and c,
storing the result in r0. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx_insn *
gen_sub3_insn (rtx r0, rtx r1, rtx c)
{
enum insn_code icode = optab_handler (sub_optab, GET_MODE (r0));
if (icode == CODE_FOR_nothing
|| !insn_operand_matches (icode, 0, r0)
|| !insn_operand_matches (icode, 1, r1)
|| !insn_operand_matches (icode, 2, c))
return NULL;
return GEN_FCN (icode) (r0, r1, c);
}
1991-12-30 04:19:53 +01:00
int
have_sub2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode;
gcc_assert (GET_MODE (x) != VOIDmode);
icode = optab_handler (sub_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
if (!insn_operand_matches (icode, 0, x)
|| !insn_operand_matches (icode, 1, x)
|| !insn_operand_matches (icode, 2, y))
return 0;
return 1;
1991-12-30 04:19:53 +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
enum insn_code
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_extend_p (machine_mode to_mode, 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;
#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 convert_optab_handler (tab, to_mode, from_mode);
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_insn *
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
gen_extend_insn (rtx x, rtx y, machine_mode mto,
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,
or CODE_FOR_nothing if these modes cannot be directly converted.
1991-12-30 04:19:53 +01: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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_fix_p (machine_mode fixmode, 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 = convert_optab_handler (tab, fixmode, fltmode);
* 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
if (icode != CODE_FOR_nothing)
{
*truncp_ptr = 0;
return icode;
}
1991-12-30 04:19:53 +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 = convert_optab_handler (tab, fixmode, fltmode);
* 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
if (icode != CODE_FOR_nothing
&& optab_handler (ftrunc_optab, fltmode) != 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;
}
enum insn_code
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_float_p (machine_mode fltmode, 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 convert_optab_handler (tab, fltmode, fixmode);
1991-12-30 04:19:53 +01:00
}
/* Function supportable_convert_operation
Check whether an operation represented by the code CODE is a
convert operation that is supported by the target platform in
vector form (i.e., when operating on arguments of type VECTYPE_IN
producing a result of type VECTYPE_OUT).
Convert operations we currently support directly are FIX_TRUNC and FLOAT.
This function checks if these operations are supported
by the target platform either directly (via vector tree-codes), or via
target builtins.
Output:
- CODE1 is code of vector operation to be used when
vectorizing the operation, if available.
- DECL is decl of target builtin functions to be used
when vectorizing the operation, if available. In this case,
CODE1 is CALL_EXPR. */
bool
supportable_convert_operation (enum tree_code code,
tree vectype_out, tree vectype_in,
tree *decl, enum tree_code *code1)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode m1,m2;
int truncp;
m1 = TYPE_MODE (vectype_out);
m2 = TYPE_MODE (vectype_in);
/* First check if we can done conversion directly. */
if ((code == FIX_TRUNC_EXPR
&& can_fix_p (m1,m2,TYPE_UNSIGNED (vectype_out), &truncp)
!= CODE_FOR_nothing)
|| (code == FLOAT_EXPR
&& can_float_p (m1,m2,TYPE_UNSIGNED (vectype_in))
!= CODE_FOR_nothing))
{
*code1 = code;
return true;
}
/* Now check for builtin. */
if (targetm.vectorize.builtin_conversion
&& targetm.vectorize.builtin_conversion (code, vectype_out, vectype_in))
{
*code1 = CALL_EXPR;
*decl = targetm.vectorize.builtin_conversion (code, vectype_out, vectype_in);
return true;
}
return false;
}
1991-12-30 04:19:53 +01:00
/* Generate code to convert FROM to floating point
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
expand_float (rtx to, rtx from, int unsignedp)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx target = to;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode fmode, imode;
bool can_do_signed = false;
1991-12-30 04:19:53 +01:00
/* Crash now, because we won't be able to decide which mode to use. */
gcc_assert (GET_MODE (from) != VOIDmode);
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. */
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;
if (fmode != GET_MODE (to)
&& significand_size (fmode) < GET_MODE_PRECISION (GET_MODE (from)))
continue;
1991-12-30 04:19:53 +01:00
icode = can_float_p (fmode, imode, unsignedp);
if (icode == CODE_FOR_nothing && unsignedp)
{
enum insn_code scode = can_float_p (fmode, imode, 0);
if (scode != CODE_FOR_nothing)
can_do_signed = true;
if (imode != GET_MODE (from))
icode = scode, doing_unsigned = 0;
}
1991-12-30 04:19:53 +01:00
if (icode != CODE_FOR_nothing)
{
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;
}
}
1991-12-30 04:19:53 +01:00
Reapply reverted change: gcc/ada/ Reapply reverted change: 2007-09-06 Eric Botcazou <ebotcazou@adacore.com> * trans.c (convert_with_check): Update call to real_2expN. gcc/ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto. Reapply reverted changes: 2007-09-06 Jan Hubicka <jh@suse.cz> * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of real_2expN. 2007-09-06 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2) (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN. 2007-09-05 Janis Johnson <janis187@us.ibm.com> * optabs.c (expand_float): Convert unsigned integer as signed only if it provides sufficient accuracy; add mode argument to real_2expN. (expand_fix): Fix comment typos; extend binary float into mode wider than destination for converion to unsigned integer; add mode argument to real_2expN. * real.c (real_2expN): Add mode argument to special-case decimal float values. * real.h (real_2expN): Ditto. * fixed-value.c (check_real_for_fixed_mode): Add mode argument to real_2expN. (fixed_from_string): Ditto. (fixed_to_decimal): Ditto. (fixed_convert_from_real): Ditto. (real_convert_from_fixed): Ditto. * config/rs6000/rs6000.md (FP): Include DD and TD modes. * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3, muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1, floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New. From-SVN: r128247
2007-09-07 18:42:48 +02:00
/* Unsigned integer, and no way to convert directly. Convert as signed,
then unconditionally adjust the result. */
if (unsignedp && can_do_signed)
1991-12-30 04:19:53 +01:00
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_code_label *label = gen_label_rtx ();
1991-12-30 04:19:53 +01:00
rtx temp;
REAL_VALUE_TYPE offset;
/* 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. */
for (fmode = GET_MODE (to); fmode != VOIDmode;
fmode = GET_MODE_WIDER_MODE (fmode))
if (GET_MODE_PRECISION (GET_MODE (from)) < GET_MODE_BITSIZE (fmode)
&& can_float_p (fmode, GET_MODE (from), 0) != CODE_FOR_nothing)
break;
if (fmode == VOIDmode)
{
/* There is no such mode. Pretend the target is wide enough. */
fmode = GET_MODE (to);
1996-07-04 00:07:53 +02:00
/* Avoid double-rounding when TO is narrower than FROM. */
if ((significand_size (fmode) + 1)
< GET_MODE_PRECISION (GET_MODE (from)))
{
rtx temp1;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_code_label *neglabel = gen_label_rtx ();
/* Don't use TARGET if it isn't a register, is a hard register,
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)
|| REGNO (target) < FIRST_PSEUDO_REGISTER
|| GET_MODE (target) != fmode)
target = gen_reg_rtx (fmode);
imode = GET_MODE (from);
do_pending_stack_adjust ();
/* Test whether the sign bit is set. */
emit_cmp_and_jump_insns (from, const0_rtx, LT, NULL_RTX, imode,
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
2001-11-16 00:44:58 +01:00
0, neglabel);
/* The sign bit is not set. Convert as signed. */
expand_float (target, from, 0);
emit_jump_insn (targetm.gen_jump (label));
emit_barrier ();
/* 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,
NULL_RTX, 1, OPTAB_LIB_WIDEN);
temp1 = expand_shift (RSHIFT_EXPR, imode, from, 1, NULL_RTX, 1);
temp = expand_binop (imode, ior_optab, temp, temp1, temp, 1,
OPTAB_LIB_WIDEN);
expand_float (target, temp, 0);
/* Multiply by 2 to undo the shift above. */
temp = expand_binop (fmode, add_optab, target, target,
target, 0, OPTAB_LIB_WIDEN);
if (temp != target)
emit_move_insn (target, temp);
do_pending_stack_adjust ();
emit_label (label);
goto done;
}
}
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. */
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)
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 ();
emit_cmp_and_jump_insns (from, const0_rtx, GE, NULL_RTX, GET_MODE (from),
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
2001-11-16 00:44:58 +01:00
0, label);
real_2expN (&offset, GET_MODE_PRECISION (GET_MODE (from)), fmode);
temp = expand_binop (fmode, add_optab, target,
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);
1991-12-30 04:19:53 +01:00
do_pending_stack_adjust ();
emit_label (label);
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;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
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
if (GET_MODE_PRECISION (GET_MODE (from)) < GET_MODE_PRECISION (SImode))
1991-12-30 04:19:53 +01:00
from = convert_to_mode (SImode, from, unsignedp);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libfunc = convert_optab_libfunc (tab, GET_MODE (to), GET_MODE (from));
gcc_assert (libfunc);
1991-12-30 04:19:53 +01:00
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,
GET_MODE (to), 1, from,
GET_MODE (from));
1991-12-30 04:19:53 +01:00
insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, target, value,
gen_rtx_fmt_e (unsignedp ? UNSIGNED_FLOAT : FLOAT,
GET_MODE (to), from));
1991-12-30 04:19:53 +01: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);
}
}
/* 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
expand_fix (rtx to, rtx from, int unsignedp)
1991-12-30 04:19:53 +01:00
{
enum insn_code icode;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx target = to;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode fmode, imode;
1991-12-30 04:19:53 +01:00
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. */
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)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
1991-12-30 04:19:53 +01:00
if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0);
if (must_trunc)
{
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);
if (maybe_emit_unop_insn (icode, target, from,
doing_unsigned ? UNSIGNED_FIX : FIX))
{
if (target != to)
convert_move (to, target, unsignedp);
return;
}
delete_insns_since (last);
1991-12-30 04:19:53 +01:00
}
}
/* 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
anything with a wider integer mode.
This code used to extend FP value into mode wider than the destination.
Reapply reverted change: gcc/ada/ Reapply reverted change: 2007-09-06 Eric Botcazou <ebotcazou@adacore.com> * trans.c (convert_with_check): Update call to real_2expN. gcc/ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto. Reapply reverted changes: 2007-09-06 Jan Hubicka <jh@suse.cz> * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of real_2expN. 2007-09-06 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2) (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN. 2007-09-05 Janis Johnson <janis187@us.ibm.com> * optabs.c (expand_float): Convert unsigned integer as signed only if it provides sufficient accuracy; add mode argument to real_2expN. (expand_fix): Fix comment typos; extend binary float into mode wider than destination for converion to unsigned integer; add mode argument to real_2expN. * real.c (real_2expN): Add mode argument to special-case decimal float values. * real.h (real_2expN): Ditto. * fixed-value.c (check_real_for_fixed_mode): Add mode argument to real_2expN. (fixed_from_string): Ditto. (fixed_to_decimal): Ditto. (fixed_convert_from_real): Ditto. (real_convert_from_fixed): Ditto. * config/rs6000/rs6000.md (FP): Include DD and TD modes. * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3, muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1, floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New. From-SVN: r128247
2007-09-07 18:42:48 +02:00
This is needed for decimal float modes which cannot accurately
represent one plus the highest signed number of the same size, but
not for binary modes. Consider, for instance conversion from SFmode
into DImode.
The hot path through 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
Reapply reverted change: gcc/ada/ Reapply reverted change: 2007-09-06 Eric Botcazou <ebotcazou@adacore.com> * trans.c (convert_with_check): Update call to real_2expN. gcc/ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto. Reapply reverted changes: 2007-09-06 Jan Hubicka <jh@suse.cz> * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of real_2expN. 2007-09-06 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2) (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN. 2007-09-05 Janis Johnson <janis187@us.ibm.com> * optabs.c (expand_float): Convert unsigned integer as signed only if it provides sufficient accuracy; add mode argument to real_2expN. (expand_fix): Fix comment typos; extend binary float into mode wider than destination for converion to unsigned integer; add mode argument to real_2expN. * real.c (real_2expN): Add mode argument to special-case decimal float values. * real.h (real_2expN): Ditto. * fixed-value.c (check_real_for_fixed_mode): Add mode argument to real_2expN. (fixed_from_string): Ditto. (fixed_to_decimal): Ditto. (fixed_convert_from_real): Ditto. (real_convert_from_fixed): Ditto. * config/rs6000/rs6000.md (FP): Include DD and TD modes. * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3, muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1, floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New. From-SVN: r128247
2007-09-07 18:42:48 +02:00
inclusive. (as for other input overflow happens and result is undefined)
So we know that the most important bit set in mantissa corresponds to
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
if (unsignedp && GET_MODE_PRECISION (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))
Reapply reverted change: gcc/ada/ Reapply reverted change: 2007-09-06 Eric Botcazou <ebotcazou@adacore.com> * trans.c (convert_with_check): Update call to real_2expN. gcc/ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto. Reapply reverted changes: 2007-09-06 Jan Hubicka <jh@suse.cz> * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of real_2expN. 2007-09-06 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2) (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN. 2007-09-05 Janis Johnson <janis187@us.ibm.com> * optabs.c (expand_float): Convert unsigned integer as signed only if it provides sufficient accuracy; add mode argument to real_2expN. (expand_fix): Fix comment typos; extend binary float into mode wider than destination for converion to unsigned integer; add mode argument to real_2expN. * real.c (real_2expN): Add mode argument to special-case decimal float values. * real.h (real_2expN): Ditto. * fixed-value.c (check_real_for_fixed_mode): Add mode argument to real_2expN. (fixed_from_string): Ditto. (fixed_to_decimal): Ditto. (fixed_convert_from_real): Ditto. (real_convert_from_fixed): Ditto. * config/rs6000/rs6000.md (FP): Include DD and TD modes. * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3, muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1, floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New. From-SVN: r128247
2007-09-07 18:42:48 +02:00
if (CODE_FOR_nothing != can_fix_p (GET_MODE (to), fmode, 0, &must_trunc)
&& (!DECIMAL_FLOAT_MODE_P (fmode)
|| GET_MODE_BITSIZE (fmode) > GET_MODE_PRECISION (GET_MODE (to))))
1991-12-30 04:19:53 +01:00
{
int bitsize;
REAL_VALUE_TYPE offset;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx limit;
rtx_code_label *lab1, *lab2;
rtx_insn *insn;
bitsize = GET_MODE_PRECISION (GET_MODE (to));
Reapply reverted change: gcc/ada/ Reapply reverted change: 2007-09-06 Eric Botcazou <ebotcazou@adacore.com> * trans.c (convert_with_check): Update call to real_2expN. gcc/ config/m68k/m68k.c (floating_exact_log2): Update call to real_2expN. config/s390/s390.md (fixuns_trunc<BFP:mode><GPR:mode>2): Ditto. Reapply reverted changes: 2007-09-06 Jan Hubicka <jh@suse.cz> * config/i386.c (ix86_expand_lround, ix86_expand_round): Update call of real_2expN. 2007-09-06 Richard Sandiford <richard@codesourcery.com> * config/mips/mips.md (fixuns_truncdfsi2, fixuns_truncdfdi2) (fixuns_truncsfsi2, fixuns_truncsfdi2): Update calls to real_2expN. 2007-09-05 Janis Johnson <janis187@us.ibm.com> * optabs.c (expand_float): Convert unsigned integer as signed only if it provides sufficient accuracy; add mode argument to real_2expN. (expand_fix): Fix comment typos; extend binary float into mode wider than destination for converion to unsigned integer; add mode argument to real_2expN. * real.c (real_2expN): Add mode argument to special-case decimal float values. * real.h (real_2expN): Ditto. * fixed-value.c (check_real_for_fixed_mode): Add mode argument to real_2expN. (fixed_from_string): Ditto. (fixed_to_decimal): Ditto. (fixed_convert_from_real): Ditto. (real_convert_from_fixed): Ditto. * config/rs6000/rs6000.md (FP): Include DD and TD modes. * config/rs6000/dfp.md (extendddtd2, adddd3, addtd3, subdd3, subtd3, muldd3, multd3, divdd3, divtd3, cmpdd_internal1, cmptd_internal1, floatditd2, ftruncdd2, fixdddi2, ftrunctd2, fixddi2): New. From-SVN: r128247
2007-09-07 18:42:48 +02:00
real_2expN (&offset, bitsize - 1, fmode);
limit = CONST_DOUBLE_FROM_REAL_VALUE (offset, fmode);
lab1 = gen_label_rtx ();
lab2 = gen_label_rtx ();
1991-12-30 04:19:53 +01:00
if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0);
/* See if we need to do the subtraction. */
do_pending_stack_adjust ();
emit_cmp_and_jump_insns (from, limit, GE, NULL_RTX, GET_MODE (from),
alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * alias.c (nonoverlapping_memrefs): Use REGNO_PTR_FRAME_P. * emit-rtl.c (change_address): Fix typo in default alignment. (adjust_address_1): Use mode of NEW, not MODE, when setting size. * expr.c (highest_pow2_factor, case WITH_RECORD_EXPR): New case. * rtl.h (REGNO_PTR_FRAME_P): New macro. * expr.c (store_field): Pass tree instead of max size; callers changed. Change handling of alignment. Only copy to_rtx if is TARGET. (expand_expr_unaligned): Delete; callers now use expand_expr. (emit_cmp_insn): No longer take ALIGN parm; all callers changed. (expand_assignment): Change handling of alignment. Only copy to_rtx if was original. (get_inner_reference): No longer return alginment; callers changed. (expand_expr, case COMPONENT_REF): Change handling of alignment. (expand_expr, case ADDR_EXPR): Make copy if not sufficiently aligned. (compare_from_rtx): Delete ALIGN parm; all callers changed. (do_compare_rtx_and_jump): Likewise. * expr.h: Reflect above changes. * tree.h: Likewise. * dwarf2out.c (loc_descriptor_from_tree): Remove ALIGN parameter to get_inner_reference. * except.c: Remove ALIGN parameter in call to emit_cmp_and_jump_insns. * explow.c: Likewise. * loop.c: Likewise. * optabs.c: Likewise. (prepare_cmp_insn): Now static; remove ALIGN parm. Callers changed. (emit_cmp_and_jump_insns): Remove ALIGN parm; all callers changed. * fold-const.c: Remove PALIGN in calls to get_inner_reference. * function.c (assign_stack_temp_for_type): No longer static. * optabs.h (emit_cmp_insn): Remove ALIGN parm. (prepare_cmp_insn): Delete declaration. * rtl.h (assign_stack_temp_for_type): Add declaration. * config/d30v/d30v.c: Reflect above changes. * config/i860/i860.c, config/ia64/ia64.c: Likewise. * config/rs6000/rs6000.c, config/sh/sh.c: Likewise. * ada/trans.c, ada/utils2.c: Remove PALIGN parameter to get_inner_reference. From-SVN: r47075
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 (targetm.gen_jump (lab2));
1991-12-30 04:19:53 +01:00
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,
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);
if (optab_handler (mov_optab, GET_MODE (to)) != CODE_FOR_nothing)
{
/* Make a place for a REG_NOTE and add it. */
insn = emit_move_insn (to, to);
set_dst_reg_note (insn, REG_EQUAL,
gen_rtx_fmt_e (UNSIGNED_FIX, GET_MODE (to),
copy_rtx (from)),
to);
}
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_PRECISION (GET_MODE (to)) < GET_MODE_PRECISION (SImode))
1991-12-30 04:19:53 +01:00
{
target = gen_reg_rtx (SImode);
expand_fix (target, from, unsignedp);
}
else
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
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;
* 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 ? ufix_optab : sfix_optab;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
libfunc = convert_optab_libfunc (tab, GET_MODE (to), GET_MODE (from));
gcc_assert (libfunc);
1991-12-30 04:19:53 +01:00
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,
GET_MODE (to), 1, from,
GET_MODE (from));
1991-12-30 04:19:53 +01:00
insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, target, value,
gen_rtx_fmt_e (unsignedp ? UNSIGNED_FIX : FIX,
GET_MODE (to), from));
1991-12-30 04:19:53 +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
}
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
/* Generate code to convert FROM or TO a fixed-point.
If UINTP is true, either TO or FROM is an unsigned integer.
If SATP is true, we need to saturate the result. */
void
expand_fixed_convert (rtx to, rtx from, int uintp, int satp)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode to_mode = GET_MODE (to);
machine_mode from_mode = GET_MODE (from);
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
convert_optab tab;
enum rtx_code this_code;
enum insn_code code;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insns;
rtx value;
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
rtx libfunc;
if (to_mode == from_mode)
{
emit_move_insn (to, from);
return;
}
if (uintp)
{
tab = satp ? satfractuns_optab : fractuns_optab;
this_code = satp ? UNSIGNED_SAT_FRACT : UNSIGNED_FRACT_CONVERT;
}
else
{
tab = satp ? satfract_optab : fract_optab;
this_code = satp ? SAT_FRACT : FRACT_CONVERT;
}
code = convert_optab_handler (tab, to_mode, from_mode);
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
if (code != CODE_FOR_nothing)
{
emit_unop_insn (code, to, from, this_code);
return;
}
libfunc = convert_optab_libfunc (tab, to_mode, from_mode);
gcc_assert (libfunc);
start_sequence ();
value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST, to_mode,
1, from, from_mode);
insns = get_insns ();
end_sequence ();
emit_libcall_block (insns, to, value,
gen_rtx_fmt_e (optab_to_code (tab), to_mode, from));
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
}
/* Generate code to convert FROM to fixed point and store in TO. FROM
must be floating point, TO must be signed. Use the conversion optab
TAB to do the conversion. */
bool
expand_sfix_optab (rtx to, rtx from, convert_optab tab)
{
enum insn_code icode;
rtx target = to;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode fmode, imode;
/* 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. */
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))
{
icode = convert_optab_handler (tab, imode, fmode);
if (icode != CODE_FOR_nothing)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last = get_last_insn ();
if (fmode != GET_MODE (from))
from = convert_to_mode (fmode, from, 0);
if (imode != GET_MODE (to))
target = gen_reg_rtx (imode);
if (!maybe_emit_unop_insn (icode, target, from, UNKNOWN))
{
delete_insns_since (last);
continue;
}
if (target != to)
convert_move (to, target, 0);
return true;
}
}
return false;
}
1991-12-30 04:19:53 +01:00
/* Report whether we have an instruction to perform the operation
specified by CODE on operands of mode MODE. */
int
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
have_insn_for (enum rtx_code code, machine_mode mode)
{
return (code_to_optab (code)
&& (optab_handler (code_to_optab (code), mode)
!= CODE_FOR_nothing));
}
/* 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
a mode name (downshifted to lowercase) followed by a single character
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.
OPNAME is the generic (string) name of the operation.
SUFFIX is the character which specifies the number of operands for
the given generic operation.
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
MODE is the mode to generate for.
*/
static void
gen_libfunc (optab optable, const char *opname, int suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
unsigned opname_len = strlen (opname);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
const char *mname = GET_MODE_NAME (mode);
unsigned mname_len = strlen (mname);
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 2;
int len = prefix_len + opname_len + mname_len + 1 + 1;
char *libfunc_name = XALLOCAVEC (char, len);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
char *p;
const char *q;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
p = libfunc_name;
*p++ = '_';
*p++ = '_';
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
if (targetm.libfunc_gnu_prefix)
{
*p++ = 'g';
*p++ = 'n';
*p++ = 'u';
*p++ = '_';
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
for (q = opname; *q; )
*p++ = *q++;
for (q = mname; *q; q++)
*p++ = TOLOWER (*q);
*p++ = suffix;
*p = '\0';
set_optab_libfunc (optable, mode,
ggc_alloc_string (libfunc_name, p - libfunc_name));
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Like gen_libfunc, but verify that integer operation is involved. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_int_libfunc (optab optable, const char *opname, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
int maxsize = 2 * BITS_PER_WORD;
int minsize = BITS_PER_WORD;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (GET_MODE_CLASS (mode) != MODE_INT)
return;
if (maxsize < LONG_LONG_TYPE_SIZE)
maxsize = LONG_LONG_TYPE_SIZE;
if (minsize > INT_TYPE_SIZE
&& (trapv_binoptab_p (optable)
|| trapv_unoptab_p (optable)))
minsize = INT_TYPE_SIZE;
if (GET_MODE_BITSIZE (mode) < minsize
|| GET_MODE_BITSIZE (mode) > maxsize)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
return;
gen_libfunc (optable, opname, suffix, mode);
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Like gen_libfunc, but verify that FP and set decimal prefix if needed. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_fp_libfunc (optab optable, const char *opname, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
char *dec_opname;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
gen_libfunc (optable, opname, suffix, mode);
if (DECIMAL_FLOAT_MODE_P (mode))
{
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
dec_opname = XALLOCAVEC (char, sizeof (DECIMAL_PREFIX) + strlen (opname));
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* For BID support, change the name to have either a bid_ or dpd_ prefix
depending on the low level floating format used. */
memcpy (dec_opname, DECIMAL_PREFIX, sizeof (DECIMAL_PREFIX) - 1);
strcpy (dec_opname + sizeof (DECIMAL_PREFIX) - 1, opname);
gen_libfunc (optable, dec_opname, suffix, mode);
}
}
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
/* Like gen_libfunc, but verify that fixed-point operation is involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_fixed_libfunc (optab optable, const char *opname, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (!ALL_FIXED_POINT_MODE_P (mode))
return;
gen_libfunc (optable, opname, suffix, mode);
}
/* Like gen_libfunc, but verify that signed fixed-point operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_signed_fixed_libfunc (optab optable, const char *opname, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (!SIGNED_FIXED_POINT_MODE_P (mode))
return;
gen_libfunc (optable, opname, suffix, mode);
}
/* Like gen_libfunc, but verify that unsigned fixed-point operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_unsigned_fixed_libfunc (optab optable, const char *opname, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (!UNSIGNED_FIXED_POINT_MODE_P (mode))
return;
gen_libfunc (optable, opname, suffix, mode);
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Like gen_libfunc, but verify that FP or INT operation is involved. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_int_fp_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (DECIMAL_FLOAT_MODE_P (mode) || GET_MODE_CLASS (mode) == MODE_FLOAT)
gen_fp_libfunc (optable, name, suffix, mode);
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
}
/* Like gen_libfunc, but verify that FP or INT operation is involved
and add 'v' suffix for integer operation. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_intv_fp_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (DECIMAL_FLOAT_MODE_P (mode) || GET_MODE_CLASS (mode) == MODE_FLOAT)
gen_fp_libfunc (optable, name, suffix, mode);
if (GET_MODE_CLASS (mode) == MODE_INT)
{
int len = strlen (name);
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
char *v_name = XALLOCAVEC (char, len + 2);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
strcpy (v_name, name);
v_name[len] = 'v';
v_name[len + 1] = 0;
gen_int_libfunc (optable, v_name, suffix, mode);
}
}
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
/* Like gen_libfunc, but verify that FP or INT or FIXED operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_int_fp_fixed_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (DECIMAL_FLOAT_MODE_P (mode) || GET_MODE_CLASS (mode) == MODE_FLOAT)
gen_fp_libfunc (optable, name, suffix, mode);
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
if (ALL_FIXED_POINT_MODE_P (mode))
gen_fixed_libfunc (optable, name, suffix, mode);
}
/* Like gen_libfunc, but verify that FP or INT or signed FIXED operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_int_fp_signed_fixed_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (DECIMAL_FLOAT_MODE_P (mode) || GET_MODE_CLASS (mode) == MODE_FLOAT)
gen_fp_libfunc (optable, name, suffix, mode);
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
if (SIGNED_FIXED_POINT_MODE_P (mode))
gen_signed_fixed_libfunc (optable, name, suffix, mode);
}
/* Like gen_libfunc, but verify that INT or FIXED operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_int_fixed_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
if (ALL_FIXED_POINT_MODE_P (mode))
gen_fixed_libfunc (optable, name, suffix, mode);
}
/* Like gen_libfunc, but verify that INT or signed FIXED operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_int_signed_fixed_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
if (SIGNED_FIXED_POINT_MODE_P (mode))
gen_signed_fixed_libfunc (optable, name, suffix, mode);
}
/* Like gen_libfunc, but verify that INT or unsigned FIXED operation is
involved. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_int_unsigned_fixed_libfunc (optab optable, const char *name, char suffix,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (INTEGRAL_MODE_P (mode))
gen_int_libfunc (optable, name, suffix, mode);
if (UNSIGNED_FIXED_POINT_MODE_P (mode))
gen_unsigned_fixed_libfunc (optable, name, suffix, mode);
}
* 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. */
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_interclass_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
* 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
{
size_t opname_len = strlen (opname);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
size_t mname_len = 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
const char *fname, *tname;
const char *q;
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 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
char *libfunc_name, *suffix;
char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix;
* 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
char *p;
/* If this is a decimal conversion, add the current BID vs. DPD prefix that
depends on which underlying decimal floating point format is used. */
const size_t dec_len = sizeof (DECIMAL_PREFIX) - 1;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode));
* 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
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
nondec_name = XALLOCAVEC (char, prefix_len + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_';
nondec_name[1] = '_';
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
if (targetm.libfunc_gnu_prefix)
{
nondec_name[2] = 'g';
nondec_name[3] = 'n';
nondec_name[4] = 'u';
nondec_name[5] = '_';
}
memcpy (&nondec_name[prefix_len], opname, opname_len);
nondec_suffix = nondec_name + opname_len + prefix_len;
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_';
dec_name[1] = '_';
memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len);
memcpy (&dec_name[2+dec_len], opname, opname_len);
dec_suffix = dec_name + dec_len + opname_len + 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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
fname = GET_MODE_NAME (fmode);
tname = GET_MODE_NAME (tmode);
* 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
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (DECIMAL_FLOAT_MODE_P (fmode) || DECIMAL_FLOAT_MODE_P (tmode))
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
libfunc_name = dec_name;
suffix = dec_suffix;
}
else
{
libfunc_name = nondec_name;
suffix = nondec_suffix;
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
p = suffix;
for (q = fname; *q; p++, q++)
*p = TOLOWER (*q);
for (q = tname; *q; p++, q++)
*p = TOLOWER (*q);
* 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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
*p = '\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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
set_conv_libfunc (tab, tmode, fmode,
ggc_alloc_string (libfunc_name, p - libfunc_name));
* 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
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Same as gen_interclass_conv_libfunc but verify that we are producing
int->fp conversion. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_int_to_fp_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (GET_MODE_CLASS (fmode) != MODE_INT)
return;
if (GET_MODE_CLASS (tmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (tmode))
return;
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* ufloat_optab is special by using floatun for FP and floatuns decimal fp
naming scheme. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_ufloat_conv_libfunc (convert_optab tab,
const char *opname ATTRIBUTE_UNUSED,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (DECIMAL_FLOAT_MODE_P (tmode))
gen_int_to_fp_conv_libfunc (tab, "floatuns", tmode, fmode);
else
gen_int_to_fp_conv_libfunc (tab, "floatun", tmode, fmode);
}
/* Same as gen_interclass_conv_libfunc but verify that we are producing
fp->int conversion. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_int_to_fp_nondecimal_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (GET_MODE_CLASS (fmode) != MODE_INT)
return;
if (GET_MODE_CLASS (tmode) != MODE_FLOAT)
return;
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Same as gen_interclass_conv_libfunc but verify that we are producing
fp->int conversion with no decimal floating point involved. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_fp_to_int_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (GET_MODE_CLASS (fmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (fmode))
return;
if (GET_MODE_CLASS (tmode) != MODE_INT)
return;
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
cgraph.c: Fix typos in comments. gcc/ * cgraph.c: Fix typos in comments. (cgraph_availability_names): Fix string typo. * fold-const.c: Fix typos in comments. (fold_binary): Fix typo in warning. * genautomata.c: Fix typos in comments. (check_presence_pattern_sets): Fix typo in local variable. (output_description): Fix typo in output. * ggc-zone.c (ggc_pch_finish): Fix typo in error message. * hwint.h: Likewise. * matrix-reorg.c (check_allocation_function): Likewise. * omega.c (smooth_weird_equations): Likewise. * auto-inc-dec.c: Fix typos in comments. * bb-reorder.c: Likewise. * builtins.c: Likewise. * c-common.c: Likewise. * c-cppbuiltin.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * cfgcleanup.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfglayout.c: Likewise. * cfgloopmanip.c: Likewise. * cgraphunit.c: Likewise. * coverage.c: Likewise. * dbxout.c: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * dfp.c: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * dse.c: Likewise. * dwarf2out.c: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * function.c: Likewise. * function.h: Likewise. * gcc.c: Likewise. * gcov-io.c: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattrtab.c: Likewise. * ggc-page.c: Likewise. * gimplify.c: Likewise. * gthr-lynx.h: Likewise. * haifa-sched.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.h: Likewise. * ipa-pure-const.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa.c: Likewise. * loop-doloop.c: Likewise. * mips-tfile.c: Likewise. * mkmap-flat.awk: Likewise. * mkmap-symver.awk: Likewise. * modulo-sched.c: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts.c: Likewise. * passes.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * pretty-print.h: Likewise. * profile.c: Likewise. * protoize.c: Likewise. * ra-conflict.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * regclass.c: Likewise. * regs.h: Likewise. * reload.c: Likewise. * rtl-error.c: Likewise. * rtlanal.c: Likewise. * scan.h: Likewise. * sched-rgn.c: Likewise. * see.c: Likewise. * stmt.c: Likewise. * target.h: Likewise. * tree-dfa.c: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-nested.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-sra.c: Likewise. * tree-ssa-alias-warnings.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa.c: Likewise. * tree-vect-analyze.c: Likewise. * tree-vect-transform.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vn.c: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * unwind-dw2-fde.c: Likewise. * unwind.inc: Likewise. * value-prof.c: Likewise. * vmsdbgout.c: Likewise. From-SVN: r136425
2008-06-06 07:42:00 +02:00
/* Initialize the libfunc fields of an of an intra-mode-class conversion optab.
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
The string formation rules are
similar to the ones for init_libfunc, above. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_intraclass_conv_libfunc (convert_optab tab, const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode, machine_mode fmode)
* 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
{
size_t opname_len = strlen (opname);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
size_t mname_len = 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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
const char *fname, *tname;
* 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
const char *q;
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
int prefix_len = targetm.libfunc_gnu_prefix ? 6 : 2;
char *nondec_name, *dec_name, *nondec_suffix, *dec_suffix;
* 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
char *libfunc_name, *suffix;
char *p;
/* If this is a decimal conversion, add the current BID vs. DPD prefix that
depends on which underlying decimal floating point format is used. */
const size_t dec_len = sizeof (DECIMAL_PREFIX) - 1;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
mname_len = strlen (GET_MODE_NAME (tmode)) + strlen (GET_MODE_NAME (fmode));
* 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
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
nondec_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 1);
nondec_name[0] = '_';
nondec_name[1] = '_';
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
if (targetm.libfunc_gnu_prefix)
{
nondec_name[2] = 'g';
nondec_name[3] = 'n';
nondec_name[4] = 'u';
nondec_name[5] = '_';
}
memcpy (&nondec_name[prefix_len], opname, opname_len);
nondec_suffix = nondec_name + opname_len + prefix_len;
driver-i386.c (detect_caches_amd, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * config/i386/driver-i386.c (detect_caches_amd, detect_caches_intel, host_detect_local_cpu): Fix -Wc++-compat and/or -Wcast-qual warnings. *ggc-common.c (ggc_mark_roots, gt_pch_note_object, gt_pch_note_reorder, relocate_ptrs, write_pch_globals, gt_pch_save): Likewise. * ggc-page.c (push_depth, push_by_depth, alloc_anon, alloc_page, gt_ggc_m_S, clear_marks, ggc_pch_read): Likewise. * global.c (compute_regsets): Likewise. * graph.c (print_rtl_graph_with_bb, clean_graph_dump_file, finish_graph_dump_file): Likewise. * haifa-sched.c (schedule_block, extend_h_i_d, extend_ready, unlink_bb_notes): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * ipa-prop.c (ipa_push_func_to_list): Likewise. * ipa-struct-reorg.c (gen_var_name, gen_cluster_name): Likewise. * local-alloc.c (update_equiv_regs): Likewise. * loop-invariant.c (check_invariant_table_size, hash_invariant_expr, eq_invariant_expr, find_or_insert_inv): Likewise. * loop-iv.c (check_iv_ref_table_size, analyzed_for_bivness_p, altered_reg_used, mark_altered): Likewise. * loop-unroll.c (si_info_eq, ve_info_eq, allocate_basic_variable, insert_var_expansion_initialization, combine_var_copies_in_loop_exit, apply_opt_in_copies, release_var_copies): Likewise. * matrix-reorg.c (mat_acc_phi_hash, mat_acc_phi_eq, mtt_info_eq, analyze_matrix_decl, add_allocation_site, analyze_transpose, analyze_accesses_for_phi_node, check_var_notmodified_p, check_allocation_function, find_sites_in_func, record_all_accesses_in_func, transform_access_sites, transform_allocation_sites): Likewise. * omp-low.c (new_omp_region, create_omp_child_function_name, check_omp_nesting_restrictions, check_combined_parallel, lower_omp_2, diagnose_sb_1, diagnose_sb_2): Likewise. * optabs.c (no_conflict_move_test, gen_libfunc, gen_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc, set_optab_libfunc, set_conv_libfunc): Likewise. * opts-common.c (prune_options): Likewise. * opts.c (add_input_filename, print_filtered_help, get_option_state): Likewise. * params.c (add_params): Likewise. * passes.c (set_pass_for_id, next_pass_1, do_per_function_toporder, pass_fini_dump_file): Likewise. * postreload.c (reload_cse_simplify_operands): Likewise. * predict.c (tree_predicted_by_p, tree_predict_edge, clear_bb_predictions, combine_predictions_for_bb): Likewise. From-SVN: r137134
2008-06-26 02:18:25 +02:00
dec_name = XALLOCAVEC (char, 2 + dec_len + opname_len + mname_len + 1 + 1);
dec_name[0] = '_';
dec_name[1] = '_';
memcpy (&dec_name[2], DECIMAL_PREFIX, dec_len);
memcpy (&dec_name[2 + dec_len], opname, opname_len);
dec_suffix = dec_name + dec_len + opname_len + 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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
fname = GET_MODE_NAME (fmode);
tname = GET_MODE_NAME (tmode);
* 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
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (DECIMAL_FLOAT_MODE_P (fmode) || DECIMAL_FLOAT_MODE_P (tmode))
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
libfunc_name = dec_name;
suffix = dec_suffix;
}
else
{
libfunc_name = nondec_name;
suffix = nondec_suffix;
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
p = suffix;
for (q = fname; *q; p++, q++)
*p = TOLOWER (*q);
for (q = tname; *q; p++, q++)
*p = TOLOWER (*q);
* 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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
*p++ = '2';
*p = '\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
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
set_conv_libfunc (tab, tmode, fmode,
ggc_alloc_string (libfunc_name, p - libfunc_name));
* 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
}
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* Pick proper libcall for trunc_optab. We need to chose if we do
truncation or extension and interclass or intraclass. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_trunc_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (GET_MODE_CLASS (tmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (tmode))
return;
if (GET_MODE_CLASS (fmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (fmode))
return;
if (tmode == fmode)
return;
if ((GET_MODE_CLASS (tmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (fmode))
|| (GET_MODE_CLASS (fmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (tmode)))
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (GET_MODE_PRECISION (fmode) <= GET_MODE_PRECISION (tmode))
return;
if ((GET_MODE_CLASS (tmode) == MODE_FLOAT
&& GET_MODE_CLASS (fmode) == MODE_FLOAT)
|| (DECIMAL_FLOAT_MODE_P (fmode) && DECIMAL_FLOAT_MODE_P (tmode)))
gen_intraclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Pick proper libcall for extend_optab. We need to chose if we do
truncation or extension and interclass or intraclass. */
void
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gen_extend_conv_libfunc (convert_optab tab,
const char *opname ATTRIBUTE_UNUSED,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
{
if (GET_MODE_CLASS (tmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (tmode))
return;
if (GET_MODE_CLASS (fmode) != MODE_FLOAT && !DECIMAL_FLOAT_MODE_P (fmode))
return;
if (tmode == fmode)
return;
if ((GET_MODE_CLASS (tmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (fmode))
|| (GET_MODE_CLASS (fmode) == MODE_FLOAT && DECIMAL_FLOAT_MODE_P (tmode)))
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +01:00
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (GET_MODE_PRECISION (fmode) > GET_MODE_PRECISION (tmode))
return;
if ((GET_MODE_CLASS (tmode) == MODE_FLOAT
&& GET_MODE_CLASS (fmode) == MODE_FLOAT)
|| (DECIMAL_FLOAT_MODE_P (fmode) && DECIMAL_FLOAT_MODE_P (tmode)))
gen_intraclass_conv_libfunc (tab, opname, tmode, fmode);
}
* 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
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
/* Pick proper libcall for fract_optab. We need to chose if we do
interclass or intraclass. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_fract_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (tmode == fmode)
return;
if (!(ALL_FIXED_POINT_MODE_P (tmode) || ALL_FIXED_POINT_MODE_P (fmode)))
return;
if (GET_MODE_CLASS (tmode) == GET_MODE_CLASS (fmode))
gen_intraclass_conv_libfunc (tab, opname, tmode, fmode);
else
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Pick proper libcall for fractuns_optab. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_fractuns_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (tmode == fmode)
return;
/* One mode must be a fixed-point mode, and the other must be an integer
mode. */
if (!((ALL_FIXED_POINT_MODE_P (tmode) && GET_MODE_CLASS (fmode) == MODE_INT)
|| (ALL_FIXED_POINT_MODE_P (fmode)
&& GET_MODE_CLASS (tmode) == MODE_INT)))
return;
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Pick proper libcall for satfract_optab. We need to chose if we do
interclass or intraclass. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_satfract_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (tmode == fmode)
return;
/* TMODE must be a fixed-point mode. */
if (!ALL_FIXED_POINT_MODE_P (tmode))
return;
if (GET_MODE_CLASS (tmode) == GET_MODE_CLASS (fmode))
gen_intraclass_conv_libfunc (tab, opname, tmode, fmode);
else
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Pick proper libcall for satfractuns_optab. */
void
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
gen_satfractuns_conv_libfunc (convert_optab tab,
const char *opname,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode,
machine_mode fmode)
stdfix.h: New file. * ginclude/stdfix.h: New file. * Makefile.in (USER_H): Add $(srcdir)/ginclude/stdfix.h. (convert.o): Add dependence on fixed-value.h. * c-convert.c (convert): Support FIXED_POINT_TYPE. * c-cppbuiltin.c (builtin_define_fixed_point_constants): New function to define fixed-point constants. (c_cpp_builtins): Define fixed-point constants. * convert.c (fixed-value.h): New include. (convert_to_real): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_integer): Update comment to include fixed-point. Support FIXED_POINT_TYPE. (convert_to_complex): Support FIXED_POINT_TYPE. (convert_to_fixed): New function. * convert.h (convert_to_fixed): Declare. * genopinit.c: Add comment about $Q for only fixed-point modes. (optabs): Add fract_optab, fractuns_optab, satfract_optab, satfractuns_optab, add_optab, ssadd_optab, usadd_optab, sub_optab, sssub_optab, ussub_optab, smul_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssdiv_optab, udiv_optab, usdiv_optab, ssashl_optab, usashl_optab, neg_optab, ssneg_optab, usneg_optab for fixed-point modes. (gen_insn): Add force_fixed to track the $Q format for all fixed-point modes. * optabs.c (optab_for_tree_code): For *DIV_EXPR, LSHIFT_EXPR, PLUS_EXPR, MINUS_EXPR, MULT_EXPR, NEGATE_EXPR, return signed or unsigned saturation optabs, when type is saturating. (shift_optab_p): Return true for SS_ASHIFT or US_ASHIFT. (expand_fixed_convert): New function. (gen_fixed_libfunc, gen_signed_fixed_libfunc, gen_unsigned_fixed_libfunc, gen_int_fp_fixed_libfunc, gen_int_fp_signed_fixed_libfunc, gen_int_fixed_libfunc, gen_int_signed_fixed_libfunc, gen_int_unsigned_fixed_libfunc, gen_fract_conv_libfunc, gen_fractuns_conv_libfunc, gen_satfract_conv_libfunc, gen_satfractuns_conv_libfunc): New functions. (init_optabs): Initialize ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssmadd_widen_optab, usmadd_widen_optab, ssmsub_widen_optab, usmsub_widen_optab, ssdiv_optab, usdiv_optab, ssashl_optab, usashl_optab, ssneg_optab, usneg_optab, fract_optab, fractuns_optab, satfract_optab, satfractuns_optab. Initialize fixed-point libraries, including add, ssadd, usadd, sub, sssub, ussub, mul, ssmul, usmul, div, ssdiv, udiv, usdiv, ashl, ssashl, usashl, ashr, lshr, neg, ssneg, usneg, cmp, fract, satfract, fractuns, satfractuns. * optabs.h (enum optab_index): Add OTI_ssadd, OTI_usadd, OTI_sssub, OTI_ussub, OTI_ssmul, OTI_usmul, OTI_ssdiv, OTI_usdiv, OTI_ssneg, OTI_usneg, OTI_ssashl, OTI_usashl, OTI_ssmadd_widen, OTI_usmadd_widen, OTI_ssmsub_widen, OTI_usmsub_widen. (ssadd_optab, usadd_optab, sssub_optab, ussub_optab, ssmul_optab, usmul_optab, ssdiv_optab, usdiv_optab, ssneg_optab, usneg_optab, ssashl_optab, usashl_optab, ssmadd_widen_optab, usmadd_widen_optab, umsub_widen_optab, usmsub_widen_optab): Define. (enum convert_optab_index): Add COI_fract, COI_fractuns, COI_satfract, COI_satfractuns. (fract_optab, fractuns_optab, satfract_optab, satfractuns_optab): Define. (expand_fixed_convert): Declare. * expr.c (convert_move): Support the move of fixed-point modes. (emit_move_insn_1): Handle fixed-point mode to move via integer. (categorize_ctor_elements_1): Handle FIXED_CST. (count_type_elements): Handle FIXED_POINT_TYPE. (expand_expr_real_1): For VECTOR_CST, check MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. Support FIXED_CST. For PLUS_EXPR and MINUS_EXPR, support saturating and non-saturating multiply and add/subtract for fixed-point types. For MULT_EXPR, *DIV_EXPR, *SHIFT_EXPR, if the mode if a fixed-point mode, we jump to binop directly. Support FIXED_CONVERT_EXPR. (do_store_flag): Check FIXED_CST to put a constant second. (vector_mode_valid_p): Handle MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (const_vector_from_tree): Support FIXED_CST. * doc/extend.texi (Fixed-Point): New node. * doc/md.texi (ssadd, usadd, sssub, ussub, ssmul, usmul, ssdiv, usdiv, ssmadd, usmadd, ssmsub, usmsub, ssashl, usashl, ssneg, usneg, fract, satfract, fractuns, satfractuns): Document them. From-SVN: r128218
2007-09-07 03:24:09 +02:00
{
if (tmode == fmode)
return;
/* TMODE must be a fixed-point mode, and FMODE must be an integer mode. */
if (!(ALL_FIXED_POINT_MODE_P (tmode) && GET_MODE_CLASS (fmode) == MODE_INT))
return;
gen_interclass_conv_libfunc (tab, opname, tmode, fmode);
}
/* Hashtable callbacks for libfunc_decls. */
hash-traits.h (ggc_hasher): Rename to... gcc/ * hash-traits.h (ggc_hasher): Rename to... (ggc_remover): ...this and remove typedefs. (ggc_cache_hasher): Update accordingly. Add typedefs. (ggc_ptr_hash): New class. * hash-table.h: Update comment. * cfgloop.h (loop_exit_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. * cgraph.h (section_name_hasher, cgraph_edge_hasher): Likewise. (tree_descriptor_hasher): Likewise. * cgraph.c (function_version_hasher): Likewise. * dwarf2out.c (indirect_string_hasher, dwarf_file_hasher): Likewise. (decl_die_hasher, block_die_hasher, decl_loc_hasher): Likewise. (dw_loc_list_hasher, addr_hasher): Likewise. * function.h (used_type_hasher): Likewise. * function.c (temp_address_hasher): Likewise. * gimple-ssa.h (tm_restart_hasher, ssa_name_hasher): Likewise. * libfuncs.h (libfunc_hasher): Likewise. * lto-streamer.h (decl_state_hasher): Likewise. * optabs.c (libfunc_decl_hasher): Likewise. * tree-scalar-evolution.c (scev_info_hasher): Likewise. * varasm.c (section_hasher, object_block_hasher): Likewise. (const_rtx_desc_hasher): Likewise. * config/darwin.c (indirection_hasher, cfstring_hasher): Likewise. * config/rs6000/rs6000.c (toc_hasher, builtin_hasher): Likewise. gcc/c-family/ * c-common.c (c_type_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. gcc/cp/ * constexpr.c (constexpr_fundef_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. (constexpr_call_hasher): Likewise. * cp-tree.h (cxx_int_tree_map_hasher, named_label_hasher): Likewise. * decl.c (typename_hasher): Likewise. * mangle.c (conv_type_hasher): Likewise. * pt.c (spec_hasher): Likewise. * tree.c (cplus_array_hasher, list_hasher): Likewise. * typeck2.c (abstract_type_hasher): Likewise. gcc/fortran/ * trans-decl.c (module_hasher): Likewise. * trans.h (module_decl_hasher): Likewise. gcc/java/ * java-tree.h (treetreehasher): Inherit from ggc_ptr_hash rather than ggc_hasher. (ict_hasher, type_assertion_hasher): Likewise. gcc/objc/ * objc-act.c (objc_string_hasher): Inherit from ggc_ptr_hash rather than ggc_hasher. From-SVN: r224959
2015-06-25 19:06:36 +02:00
struct libfunc_decl_hasher : ggc_ptr_hash<tree_node>
{
static hashval_t
hash (tree entry)
{
return IDENTIFIER_HASH_VALUE (DECL_NAME (entry));
}
static bool
equal (tree decl, tree name)
{
return DECL_NAME (decl) == name;
}
};
/* A table of previously-created libfuncs, hashed by name. */
static GTY (()) hash_table<libfunc_decl_hasher> *libfunc_decls;
langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define. 2009-09-13 Richard Guenther <rguenther@suse.de> Rafael Avila de Espindola <espindola@google.com> * langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (LANG_HOOKS_INITIALIZER): Adjust. (lhd_pass_through_t): Declare. * langhooks.h (struct lang_hooks): Add eh_runtime_type and eh_personality. * langhooks.c (lhd_pass_through_t): New function. * dwarf2out.c (output_call_frame_info, dwarf2out_do_cfi_startproc, dwarf2out_begin_prologue): Use personality from current_function_decl. * expr.h (get_personality_function): Declare. * expr.c (get_personality_function): New function. (build_personality_function): Likewise. * libfuncs.h (libfunc_index): Remove LTI_eh_personality. (eh_personality_libfunc): Remove. * optabs.c (build_libfunc_function): New function split out from ... (init_one_libfunc): ... here. * tree.h (DECL_FUNCTION_PERSONALITY): New. (tree_function_decl): Add personality. (lhd_gcc_personality): Declare. (build_personality_function): Likewise. * tree.c (gcc_eh_personality_decl): New. (lhd_gcc_personality): New function. * except.h (lang_eh_runtime_type): Remove. (enum eh_personality_kind): New. (build_personality_function): Declare. (function_needs_eh_personality): Declare. * except.c (lang_eh_runtime_type): Remove. (function_needs_eh_personality): New function. (add_type_for_runtime): Call lang_hooks.type_for_runtime instead. (sjlj_emit_function_enter, output_function_exception_table): Use personality from current_function_decl. * tree-eh.c (lower_eh_constructs): Set DECL_FUNCTION_PERSONALITY. * tree-inline.c (tree_can_inline_p): Do not inline across different EH personalities. (expand_call_inline): Likewise. Adjust the callers EH personality. (tree_function_versioning): Copy DECL_FUNCTION_PERSONALITY. * cgraph.c (cgraph_add_new_function): Set DECL_FUNCTION_PERSONALITY. * Makefile.in (cgraph.o): Add $(EXCEPT_H) dependency. (c-parser.o): Likewise * c-tree.h (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-decl.c (finish_decl): Don't call c_maybe_initialize_eh. (finish_decl): Don't call c_maybe_initialize_eh. (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-parser.c (c_parser_omp_construct): Likewise. (c_parse_file): Initialize exception handling. objc/ * objc-act.c (objc_eh_runtime_type): Export. (objc_init_exceptions): Remove. Move warning code ... (objc_begin_try_stmt): ... here (objc_build_throw_stmt): ... and here. (objc_eh_personality_decl): New. (objc_eh_personality): New function. * objc-act.h (objc_eh_runtime_type): Declare. (objc_eh_personality): Likewise. * objc-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. cp/ * except.c (init_exception_processing): Do not set lang_eh_runtime_type. (choose_personality_routine): Do not set eh_personality_decl, set pragma_java_exceptions. * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (cp_eh_personality_decl): New. (cp_eh_personality): Likewise. * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H) dependencies. java/ * decl.c (do_nothing): Remove. (java_init_decl_processing): Do not set lang_eh_runtime_type. * Make-lang.in (lang.o): Add $(EXCEPT_H) dependency. * lang.c (java_eh_personality): New. (java_eh_personality_decl): Likewise. (LANG_HOOKS_EH_PERSONALITY): Define. ada/ * gcc-interface/misc.c (gnat_init_gcc_eh): Do not set lang_eh_runtime_type. (LANG_HOOKS_EH_PERSONALITY): Define. (gnat_eh_personality_decl): New. (gnat_eh_personality): Likewise. * Make-lang.in (misc.o): Add gt-ada-misc.h dependency. * config-lang.in (gtfiles): Add misc.c. fortran/ * f95-lang.c (gfc_maybe_initialize_eh): Do not init eh_personality_libfunc. Co-Authored-By: Rafael Avila de Espindola <espindola@google.com> From-SVN: r151676
2009-09-13 21:40:33 +02:00
/* Build a decl for a libfunc named NAME. */
tree
build_libfunc_function (const char *name)
{
tree decl = build_decl (UNKNOWN_LOCATION, FUNCTION_DECL,
get_identifier (name),
build_function_type (integer_type_node, NULL_TREE));
/* ??? We don't have any type information except for this is
a function. Pretend this is "int foo()". */
DECL_ARTIFICIAL (decl) = 1;
DECL_EXTERNAL (decl) = 1;
TREE_PUBLIC (decl) = 1;
gcc_assert (DECL_ASSEMBLER_NAME (decl));
/* Zap the nonsensical SYMBOL_REF_DECL for this. What we're left with
are the flags assigned by targetm.encode_section_info. */
SET_SYMBOL_REF_DECL (XEXP (DECL_RTL (decl), 0), NULL);
return decl;
}
rtx
init_one_libfunc (const char *name)
{
tree id, decl;
hashval_t hash;
if (libfunc_decls == NULL)
libfunc_decls = hash_table<libfunc_decl_hasher>::create_ggc (37);
/* See if we have already created a libfunc decl for this function. */
id = get_identifier (name);
hash = IDENTIFIER_HASH_VALUE (id);
tree *slot = libfunc_decls->find_slot_with_hash (id, hash, INSERT);
decl = *slot;
if (decl == NULL)
{
/* Create a new decl, so that it can be passed to
targetm.encode_section_info. */
langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define. 2009-09-13 Richard Guenther <rguenther@suse.de> Rafael Avila de Espindola <espindola@google.com> * langhooks-def.h (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (LANG_HOOKS_INITIALIZER): Adjust. (lhd_pass_through_t): Declare. * langhooks.h (struct lang_hooks): Add eh_runtime_type and eh_personality. * langhooks.c (lhd_pass_through_t): New function. * dwarf2out.c (output_call_frame_info, dwarf2out_do_cfi_startproc, dwarf2out_begin_prologue): Use personality from current_function_decl. * expr.h (get_personality_function): Declare. * expr.c (get_personality_function): New function. (build_personality_function): Likewise. * libfuncs.h (libfunc_index): Remove LTI_eh_personality. (eh_personality_libfunc): Remove. * optabs.c (build_libfunc_function): New function split out from ... (init_one_libfunc): ... here. * tree.h (DECL_FUNCTION_PERSONALITY): New. (tree_function_decl): Add personality. (lhd_gcc_personality): Declare. (build_personality_function): Likewise. * tree.c (gcc_eh_personality_decl): New. (lhd_gcc_personality): New function. * except.h (lang_eh_runtime_type): Remove. (enum eh_personality_kind): New. (build_personality_function): Declare. (function_needs_eh_personality): Declare. * except.c (lang_eh_runtime_type): Remove. (function_needs_eh_personality): New function. (add_type_for_runtime): Call lang_hooks.type_for_runtime instead. (sjlj_emit_function_enter, output_function_exception_table): Use personality from current_function_decl. * tree-eh.c (lower_eh_constructs): Set DECL_FUNCTION_PERSONALITY. * tree-inline.c (tree_can_inline_p): Do not inline across different EH personalities. (expand_call_inline): Likewise. Adjust the callers EH personality. (tree_function_versioning): Copy DECL_FUNCTION_PERSONALITY. * cgraph.c (cgraph_add_new_function): Set DECL_FUNCTION_PERSONALITY. * Makefile.in (cgraph.o): Add $(EXCEPT_H) dependency. (c-parser.o): Likewise * c-tree.h (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-decl.c (finish_decl): Don't call c_maybe_initialize_eh. (finish_decl): Don't call c_maybe_initialize_eh. (c_eh_initialized_p): Remove. (c_maybe_initialize_eh): Likewise. * c-parser.c (c_parser_omp_construct): Likewise. (c_parse_file): Initialize exception handling. objc/ * objc-act.c (objc_eh_runtime_type): Export. (objc_init_exceptions): Remove. Move warning code ... (objc_begin_try_stmt): ... here (objc_build_throw_stmt): ... and here. (objc_eh_personality_decl): New. (objc_eh_personality): New function. * objc-act.h (objc_eh_runtime_type): Declare. (objc_eh_personality): Likewise. * objc-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. cp/ * except.c (init_exception_processing): Do not set lang_eh_runtime_type. (choose_personality_routine): Do not set eh_personality_decl, set pragma_java_exceptions. * cp-lang.c (LANG_HOOKS_EH_RUNTIME_TYPE): Define. (LANG_HOOKS_EH_PERSONALITY): Likewise. (cp_eh_personality_decl): New. (cp_eh_personality): Likewise. * Make-lang.in (cp-lang.o): Add $(EXPR_H) and $(EXCEPT_H) dependencies. java/ * decl.c (do_nothing): Remove. (java_init_decl_processing): Do not set lang_eh_runtime_type. * Make-lang.in (lang.o): Add $(EXCEPT_H) dependency. * lang.c (java_eh_personality): New. (java_eh_personality_decl): Likewise. (LANG_HOOKS_EH_PERSONALITY): Define. ada/ * gcc-interface/misc.c (gnat_init_gcc_eh): Do not set lang_eh_runtime_type. (LANG_HOOKS_EH_PERSONALITY): Define. (gnat_eh_personality_decl): New. (gnat_eh_personality): Likewise. * Make-lang.in (misc.o): Add gt-ada-misc.h dependency. * config-lang.in (gtfiles): Add misc.c. fortran/ * f95-lang.c (gfc_maybe_initialize_eh): Do not init eh_personality_libfunc. Co-Authored-By: Rafael Avila de Espindola <espindola@google.com> From-SVN: r151676
2009-09-13 21:40:33 +02:00
decl = build_libfunc_function (name);
*slot = decl;
}
return XEXP (DECL_RTL (decl), 0);
}
/* Adjust the assembler name of libfunc NAME to ASMSPEC. */
rtx
set_user_assembler_libfunc (const char *name, const char *asmspec)
{
tree id, decl;
hashval_t hash;
id = get_identifier (name);
hash = IDENTIFIER_HASH_VALUE (id);
tree *slot = libfunc_decls->find_slot_with_hash (id, hash, NO_INSERT);
gcc_assert (slot);
decl = (tree) *slot;
set_user_assembler_name (decl, asmspec);
return XEXP (DECL_RTL (decl), 0);
}
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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
set_optab_libfunc (optab op, machine_mode mode, const char *name)
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
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx val;
struct libfunc_entry e;
struct libfunc_entry **slot;
e.op = op;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
e.mode1 = mode;
e.mode2 = VOIDmode;
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
if (name)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
val = init_one_libfunc (name);
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
else
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
val = 0;
slot = libfunc_hash->find_slot (&e, INSERT);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (*slot == NULL)
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
*slot = ggc_alloc<libfunc_entry> ();
(*slot)->op = op;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
(*slot)->mode1 = mode;
(*slot)->mode2 = VOIDmode;
(*slot)->libfunc = val;
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
}
* 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
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
set_conv_libfunc (convert_optab optab, machine_mode tmode,
machine_mode fmode, const char *name)
* 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
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
rtx val;
struct libfunc_entry e;
struct libfunc_entry **slot;
e.op = optab;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
e.mode1 = tmode;
e.mode2 = fmode;
* 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
if (name)
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
val = init_one_libfunc (name);
* 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
else
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
val = 0;
slot = libfunc_hash->find_slot (&e, INSERT);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (*slot == NULL)
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
*slot = ggc_alloc<libfunc_entry> ();
(*slot)->op = optab;
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
(*slot)->mode1 = tmode;
(*slot)->mode2 = fmode;
(*slot)->libfunc = val;
* 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
}
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Call this to initialize the contents of the optabs
1991-12-30 04:19:53 +01:00
appropriately for the current target machine. */
void
init_optabs (void)
1991-12-30 04:19:53 +01:00
{
if (libfunc_hash)
libfunc_hash->empty ();
else
libfunc_hash = hash_table<libfunc_hasher>::create_ggc (10);
/* Fill in the optabs with the insns we support. */
init_all_optabs (this_fn_optabs);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
/* The ffs function operates on `int'. Fall back on it if we do not
have a libgcc2 function for that width. */
if (INT_TYPE_SIZE < BITS_PER_WORD)
matrix-reorg.c (analyze_matrix_allocation_site): Remove unused malloc_fname variable. * matrix-reorg.c (analyze_matrix_allocation_site): Remove unused malloc_fname variable. (check_allocation_function): Remove unused gsi and bb_level_0 variables. (transform_access_sites): Remove unused d_type_size and d_type_size_k variables. * omega.c (resurrect_subs): Remove unused n variable. (omega_solve_geq): Remove unused neweqns variable. * lto-streamer-in.c (lto_read_tree): Remove unused end_marker variable. * tree-inline.c (declare_return_variable): Remove USE_P argument, return use instead of var. (remap_decl, remap_block): Remove unused fn variable. (expand_call_inline): Remove unused retvar variable, adjust declare_return_variable caller. (optimize_inline_calls): Remove unused prev_fn variable. * tree-vect-slp.c (vect_analyze_slp_instance): Remove unused ncopies variable. (vect_create_mask_and_perm): Remove unused group_size and dr_chain_size variables. * tree-ssa-loop-niter.c (split_to_var_and_offset): Handle MINUS_EXPR properly. * tree-vect-loop.c (vect_analyze_loop_form): Remove unused backedge variable. (vect_create_epilog_for_reduction): Remove unused bytesize variable. * omp-low.c (workshare_safe_to_combine_p): Remove par_entry_bb parameter. Remove unused par_stmt variable. (determine_parallel_type): Adjust workshare_safe_to_combine_p caller. (expand_omp_sections): Remove unused l1 variable. (lower_omp_for): Remove unused ilist variable. * tree-loop-distribution.c (mark_nodes_having_upstream_mem_writes): Remove unused has_upstream_mem_write_p variable. * recog.c (decode_asm_operands): Remove unused noperands variable. * tree-ssa-alias.c (refs_may_alias_p_1): Remove unused size1 and size2 variable. * libgcov.c (__gcov_merge_delta): Remove unused last variable. * tree-call-cdce.c (gen_conditions_for_pow_int_base): Remove unused base_nm variable. (gen_conditions_for_pow): Remove unused ec variable. * tree-ssa-sccvn.c (vn_reference_lookup_3): Remove unused size variable. * ipa-struct-reorg.c (program_redefines_malloc_p): Remove unused fndecl variable. * tree-ssa-sink.c (statement_sink_location): Remove unused code variable. * regmove.c (copy_src_to_dest): Remove unused insn_uid and move_uid variables. * tree-complex.c (create_one_component_var): Remove unused inner_type variable. * calls.c (emit_call_1): Don't GEN_INT (struct_value_size) unnecessarily when GEN_*CALL omits that argument. * regrename.c (regrename_optimize): Remove unused regs_seen variable. (build_def_use): Remove unused icode variable. * ipa-pure-const.c (check_call): Remove unused callee and avail variables. * tree-dfa.c (add_referenced_var): Remove unused v_ann variable. * tree-vect-patterns.c (vect_recog_pow_pattern): Remove unused type variable. (vect_pattern_recog): Remove unused stmt variable. * sel-sched-ir.c (make_regions_from_the_rest): Remove unused new_regions variable. * postreload.c (reload_cse_simplify_operands): Remove unused mode variable. * tree-parloops.c (create_call_for_reduction_1): Remove unused addr_type variable. (create_parallel_loop): Remove unused res variable. (gen_parallel_loop): Remove unused nloop variable. * tree-vect-loop-manip.c (vect_loop_versioning): Likewise. * value-prof.c (gimple_mod_subtract_transform, gimple_stringops_transform): Remove unused value variable. (gimple_stringops_values_to_profile): Remove unused fcode variable. * tree-vrp.c (register_new_assert_for): Remove unused found variable. (vrp_visit_switch_stmt): Remove unused n variable. * tree-vect-stmts.c (vectorizable_conversion): Remove unused expr variable. (vectorizable_operation): Remove unused shift_p variable. (vectorizable_store): Remove unused first_stmt_vinfo variable. * tree-ssa-operands.c (add_stmt_operand): Remove unused v_ann variable. * tree-vect-data-refs.c (vect_analyze_data_refs): Remove unused bb variable. (vect_permute_store_chain): Remove unused scalar_dest variable. (vect_supportable_dr_alignment): Remove unused invariant_in_outerloop variable. * tree-ssa-threadupdate.c (thread_single_edge): Remove unused local_info variable. * tree-optimize.c (tree_rest_of_compilation): Remove unused node variable. * optabs.c (expand_binop): Remove unused equiv_value variable. (emit_libcall_block): Remove unused prev variable. (init_optabs): Remove unused int_mode variable. * tree-ssa-structalias.c (scc_visit): Remove unused have_ref_node variable. (do_structure_copy): Remove unused lhsbase and rhsbase variables. (find_func_aliases): Remove unused rhstype variable. (ipa_pta_execute): Remove unused varid variable. gcc/objc/ * objc-act.c (generate_shared_structures): Remove unused sc_spec and decl_specs variables. (objc_build_message_expr): Remove unused loc variable. (objc_finish_message_expr): Remove unused saved_rtype variable. (encode_field_decl): Remove unused type variable. gcc/lto/ * lto-lang.c (handle_nonnull_attribute): Remove unused attr_arg_num variable. From-SVN: r154726
2009-11-28 17:21:00 +01:00
set_optab_libfunc (ffs_optab, mode_for_size (INT_TYPE_SIZE, MODE_INT, 0),
"ffs");
extend.texi (__builtin_bswap32): Document. 2006-09-07 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. Co-Authored-By: Falk Hueffner <falk@debian.org> From-SVN: r118361
2006-11-01 06:14:40 +01:00
/* Explicitly initialize the bswap libfuncs since we need them to be
valid for things other than word_mode. */
libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. gcc/ * libgcc2.h (__NW, __NDW): Define using a __gnu_ prefix if LIBGCC2_GNU_PREFIX is defined. (__N): New macro. (__powisf2, __powidf2, __powitf2, __powixf2, __bswapsi2, __bswapdi2, __mulsc3, __muldc3, __mulxc3, __multc3, __divsc3, __divdc3, __divxc3, __divtc3, __udiv_w_sdiv, __clear_cache, __enable_execute_stack, __clz_tab): Define using __N. (__absvsi2, __negvsi2, __addvsi3, __subvsi3, __mulvsi3): Likewise if COMPAT_SIMODE_TRAPPING_ARITHMETIC. * target.def (libfunc_gnu_prefix): New hook. * doc/tm.texi.in (LIBGCC2_GNU_PREFIX): Document. (TARGET_LIBFUNC_GNU_PREFIX): Add hook. * doc/tm.texi: Regenerate. * system.h (LIBGCC2_GNU_PREFIX): Poison. * optabs.c (gen_libfunc): Take the libfunc_gnu_prefix hook into account. (gen_interclass_conv_libfunc, gen_intraclass_conv_libfunc): Likewise. (init_optabs): Likewise for the bswap libfuncs. * tree.c (build_common_builtin_nodes): Likewise for complex multiply and divide. * config/t-slibgcc-elf-ver (SHLIB_MAPFILES): Use $$(libgcc_objdir). * config/t-slibgcc-sld (SHLIB_MAPFILES): Likewise. * libgcc-std.ver: Remove. * Makefile.in (srcdirify): Handle $$(libgcc_objdir). * config/frv/t-linux (SHLIB_MAPFILES): Use $$(libgcc_objdir) for libgcc-std.ver. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/mips/t-slibgcc-irix (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix43 (SHLIB_MAPFILES): Likewise. * config/rs6000/t-aix52 (SHLIB_MAPFILES): Likewise. * config/sparc/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/i386/t-linux (SHLIB_MAPFILES): Likewise. * config/fixed-bit.h (FIXED_OP): Define differently depending on LIBGCC2_GNU_PREFIX. All uses changed not to pass leading underscores. (FIXED_CONVERT_OP, FIXED_CONVERT_OP2): Likewise. libgcc/ * libgcc-std.ver.in: New file. * Makefile.in (LIBGCC_VER_GNU_PREFIX, LIBGCC_VER_SYMBOLS_PREFIX): New variables. (libgcc-std.ver): New rule. * config/t-gnu-prefix: New file. From-SVN: r174187
2011-05-25 14:11:42 +02:00
if (targetm.libfunc_gnu_prefix)
{
set_optab_libfunc (bswap_optab, SImode, "__gnu_bswapsi2");
set_optab_libfunc (bswap_optab, DImode, "__gnu_bswapdi2");
}
else
{
set_optab_libfunc (bswap_optab, SImode, "__bswapsi2");
set_optab_libfunc (bswap_optab, DImode, "__bswapdi2");
}
extend.texi (__builtin_bswap32): Document. 2006-09-07 Eric Christopher <echristo@apple.com> Falk Hueffner <falk@debian.org> * doc/extend.texi (__builtin_bswap32): Document. (__builtin_bswap64): Ditto. * doc/libgcc.texi (bswapsi2): Document. (bswapdi2): Ditto. * doc/rtl.texi (bswap): Document. * optabs.c (expand_unop): Don't widen a bswap. (init_optabs): Init bswap. Set libfuncs explicitly for bswapsi2 and bswapdi2. * optabs.h (OTI_bswap): New. (bswap_optab): Ditto. * genopinit.c (optabs): Handle bswap_optab. * tree.h (tree_index): Add TI_UINT32_TYPE and TI_UINT64_TYPE. (uint32_type_node): New. (uint64_type_node): Ditto. * tree.c (build_common_tree_nodes_2): Initialize uint32_type_node and uint64_type_node. * builtins.c (expand_builtin_bswap): New. (expand_builtin): Call. (fold_builtin_bswap): New. (fold_builtin_1): Call. * fold-const.c (tree_expr_nonnegative_p): Return true for bswap. * builtin-types.def (BT_UINT32): New. (BT_UINT64): Ditto. (BT_FN_UINT32_UINT32): Ditto. (BT_FN_UINT64_UINT64): Ditto. * builtins.def (BUILT_IN_BSWAP32): New. (BUILT_IN_BSWAP64): Ditto. * rtl.def (BSWAP): New. * genattrtab.c (check_attr_value): New. * libgcc2.c (__bswapSI2): New. (__bswapDI2): Ditto. * libgcc2.h (__bswapSI2): Declare. (__bswapDI2): Ditto. * mklibgcc.in (lib2funcs): Add _bswapsi2 and _bswapdi2. * simplify-rtx.c (simplify_const_unary_operation): Return 0 for BSWAP. * libgcc-std.ver (__bwapsi2): Add. (__bswapdi2): Ditto. * reload1.c (eliminate_regs_1): Add bswap. (elimination_effects): Ditto. * config/i386/i386.h (x86_bswap): New. (TARGET_BSWAP): Use. * config/i386/i386.c (x86_bswap): Set. Co-Authored-By: Falk Hueffner <falk@debian.org> From-SVN: r118361
2006-11-01 06:14:40 +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
/* 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)
set_optab_libfunc (abs_optab, TYPE_MODE (complex_double_type_node),
"cabs");
abort_libfunc = init_one_libfunc ("abort");
memcpy_libfunc = init_one_libfunc ("memcpy");
memmove_libfunc = init_one_libfunc ("memmove");
memcmp_libfunc = init_one_libfunc ("memcmp");
memset_libfunc = init_one_libfunc ("memset");
setbits_libfunc = init_one_libfunc ("__setbits");
#ifndef DONT_USE_BUILTIN_SETJMP
setjmp_libfunc = init_one_libfunc ("__builtin_setjmp");
longjmp_libfunc = init_one_libfunc ("__builtin_longjmp");
#else
setjmp_libfunc = init_one_libfunc ("setjmp");
longjmp_libfunc = init_one_libfunc ("longjmp");
#endif
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
/* For function entry/exit instrumentation. */
profile_function_entry_libfunc
= init_one_libfunc ("__cyg_profile_func_enter");
profile_function_exit_libfunc
= init_one_libfunc ("__cyg_profile_func_exit");
gcov_flush_libfunc = init_one_libfunc ("__gcov_flush");
/* 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
}
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
/* Use the current target and options to initialize
TREE_OPTIMIZATION_OPTABS (OPTNODE). */
void
init_tree_optimization_optabs (tree optnode)
{
/* Quick exit if we have already computed optabs for this target. */
if (TREE_OPTIMIZATION_BASE_OPTABS (optnode) == this_target_optabs)
return;
/* Forget any previous information and set up for the current target. */
TREE_OPTIMIZATION_BASE_OPTABS (optnode) = this_target_optabs;
struct target_optabs *tmp_optabs = (struct target_optabs *)
TREE_OPTIMIZATION_OPTABS (optnode);
if (tmp_optabs)
memset (tmp_optabs, 0, sizeof (struct target_optabs));
else
use templates instead of gengtype for typed allocation functions gcc/ChangeLog: * alias.c (record_alias_subset): Adjust. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * cfgloop.c (alloc_loop): Likewise. (flow_loops_find): Likewise. (rescan_loop_exit): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cgraph.c (insert_new_cgraph_node_version): Likewise. (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_allocate_init_indirect_info): Likewise. * cgraphclones.c (cgraph_clone_edge): Likewise. * cgraphunit.c (add_asm_node): Likewise. (init_lowered_empty_function): Likewise. * config/aarch64/aarch64.c (aarch64_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_use_linkage): Likewise. * config/arc/arc.c (arc_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/c6x/c6x.c (c6x_init_machine_status): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. (darwin_build_constant_cfstring): Likewise. (darwin_enter_string_into_cfstring_table): Likewise. * config/epiphany/epiphany.c (epiphany_init_machine_status): * Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. (i386_pe_record_stub): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. (m32c_note_pragma_address): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. (mips16_local_alias): Likewise. (mips_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/msp430/msp430.c (msp430_init_machine_status): Likewise. * config/nds32/nds32.c (nds32_init_machine_status): Likewise. * config/nios2/nios2.c (nios2_init_machine_status): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (pa_get_deferred_plabel): Likewise. * config/rl78/rl78.c (rl78_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/score/score.c (score_output_external): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/spu/spu.c (spu_init_machine_status): Likewise. * config/tilegx/tilegx.c (tilegx_init_machine_status): Likewise. * config/tilepro/tilepro.c (tilepro_init_machine_status): * Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * coverage.c (coverage_end_function): Likewise. * dbxout.c (dbxout_init): Likewise. * doc/gty.texi: Don't mention variable_size attribute. * dwarf2cfi.c (new_cfi): Adjust. (new_cfi_row): Likewise. (copy_cfi_row): Likewise. (create_cie_data): Likewise. * dwarf2out.c (dwarf2out_alloc_current_fde): Likewise. (new_loc_descr): Likewise. (find_AT_string_in_table): Likewise. (add_addr_table_entry): Likewise. (new_die): Likewise. (add_var_loc_to_decl): Likewise. (clone_die): Likewise. (clone_as_declaration): Likewise. (break_out_comdat_types): Likewise. (new_loc_list): Likewise. (add_loc_descr_to_each): Likewise. (add_location_or_const_value_attribute): Likewise. (add_linkage_name): Likewise. (lookup_filename): Likewise. (dwarf2out_var_location): Likewise. (new_line_info_table): Likewise. (dwarf2out_init): Likewise. (mem_loc_descriptor): Likewise. (loc_descriptor): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (comp_dir_string): Likewise. (dwarf2out_vms_debug_main_pointer): Likewise. (string_cst_pool_decl): Likewise. * emit-rtl.c (set_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. (init_emit_regs): Likewise. * except.c (init_eh_for_function): Likewise. (gen_eh_region): Likewise. (gen_eh_region_catch): Likewise. (gen_eh_landing_pad): Likewise. (add_call_site): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (get_hard_reg_initial_val): Likewise. (allocate_struct_function): Likewise. (prepare_function_start): Likewise. (types_used_by_var_decl_insert): Likewise. * gengtype.c (variable_size_p): Remove function. (enum alloc_quantity): Remove enum. (write_typed_alloc_def): Remove function. (write_typed_struct_alloc_def): Likewise. (write_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (main): Adjust. * ggc-common.c (ggc_cleared_alloc_htab_ignore_args): Adjust. (ggc_cleared_alloc_ptr_array_two_args): Likewise. * ggc.h (ggc_alloc): new function. (ggc_cleared_alloc): Likewise. (ggc_vec_alloc): Template on type of vector element, and remove element size argument. (ggc_cleared_vec_alloc): Likewise. * gimple.c (gimple_build_omp_for): Adjust. (gimple_copy): Likewise. * ipa-cp.c (get_replacement_map): Likewise. (find_aggregate_values_for_callers_subset): Likewise. (known_aggs_to_agg_replacement_list): Likewise. * ipa-devirt.c (get_odr_type): Likewise. * ipa-prop.c (ipa_node_duplication_hook): Likewise. (read_agg_replacement_chain): Likewise. * loop-iv.c (get_simple_loop_desc): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (input_cfg): Likewise. * optabs.c (set_optab_libfunc): Likewise. (init_tree_optimization_optabs): Likewise. (set_conv_libfunc): Likewise. * passes.c (do_per_function_toporder): Likewise. * rtl.h: Don't use variable_size gty attribute. * sese.c (if_region_set_false_region): Adjust. * stringpool.c (gt_pch_save_stringpool): Likewise. * target-globals.c (save_target_globals): Likewise. * toplev.c (general_init): Likewise. * trans-mem.c (record_tm_replacement): Likewise. (split_bb_make_tm_edge): Likewise. * tree-cfg.c (move_sese_region_to_fn): Likewise. * tree-data-ref.h (lambda_vector_new): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-operands.h: Don't use variable_size gty attribute. * tree-ssa.c (init_tree_ssa): Adjust. * tree-ssanames.c (set_range_info): Likewise. (get_ptr_info): Likewise. (duplicate_ssa_name_ptr_info): Likewise. (duplicate_ssa_name_range_info): Likewise. * tree-streamer-in.c (unpack_ts_real_cst_value_fields): Likewise. (unpack_ts_fixed_cst_value_fields): Likewise. * tree.c (build_fixed): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_priority_info): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (decl_debug_args_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * ubsan.c (decl_for_type_insert): Likewise. * varasm.c (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (create_block_symbol): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. (record_tm_clone_pair): Likewise. * varpool.c (varpool_create_empty_node): Likewise. gcc/c/ChangeLog: * c-decl.c (finish_struct): Adjust. (finish_enum): Likewise. (bind): Adjust. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (store_parm_decls): Likewise. (c_push_function_context): Likewise. * c-lang.h: Remove usage of variable_size gty attribute. * c-parser.c (c_parse_init): Adjust. (c_parse_file): Likewise. gcc/java/ChangeLog: * class.c (add_method_1): Adjust. (java_treetreehash_new): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * expr.c (add_type_assertion): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (lang_decl): don't use variable_size gty attribute. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Adjust. (lang_type): Don't use variable_size gty attribute. * jcf-parse.c (java_parse_file): Adjust. (process_zip_dir): Likewise. * jcf.h: Remove usage of variable_size gty attribute. * jcf-reader.c (jcf_parse_constant_pool): Adjust. (jcf_parse_bootstrap_methods): Likewise. gcc/objc/ChangeLog: * objc-act.c (objc_build_string_object): Adjust. (continue_class): Likewise. * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Likewise. * objc-map.c (objc_map_alloc_ggc): Likewise. (objc_map_private_resize): Likewise. * objc-next-runtime-abi-02.c (objc_next_runtime_abi_02_init): Likewise. (hash_name_enter): Likewise. gcc/cp/ChangeLog: * class.c (sorted_fields_type_new): Adjust. * cp-cilkplus.c (cilk_install_body_with_frame_cleanup): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * cp-tree.h: Remove usage of variable_size gty attribute. * decl.c (make_label_decl): Adjust. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend_1): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * parser.c (cp_lexer_alloc): Likewise. (cp_lexer_new_from_tokens): Likewise. (cp_token_cache_new): Likewise. (cp_parser_context_new): Likewise. (cp_parser_new): Likewise. (cp_parser_nested_name_specifier_opt): Likewise. (cp_parser_template_id): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class_1): Likewise. (push_tinst_level): Likewise. * semantics.c (register_constexpr_fundef): Likewise. (cxx_eval_call_expression): Likewise. * typeck2.c (abstract_virtuals_error_sfinae): Likewise. gcc/fortran/ChangeLog: * f95-lang.c (pushlevel): Adjust. * trans-decl.c (gfc_allocate_lang_decl): Adjust. (gfc_find_module): Likewise. * trans-types.c (gfc_get_nodesc_array_type): Likewise. (gfc_get_array_type_bounds): Likewise. (gfc_nonrestricted_type): Likewise. * trans.h: Don't use variable_size gty attribute. gcc/ada/ChangeLog: * gcc-interface/ada-tree.h: Remove usage of variable_size gty annotation. * gcc-interface/decl.c (annotate_value): Adjust. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (push_range_check_info): Likewise. (Loop_Statement_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. * gcc-interface/utils.c (init_gnat_utils): Likewise. (gnat_pushlevel): Likewise. (maybe_pad_type): Likewise. gcc/go/ChangeLog: * go-lang.c (struct GTY): Don't use variable_size gty attribute. gcc/c-family/ChangeLog: * c-common.h (sorted_fields_type): Remove variable_size GTY attribute. * c-pragma.c (push_alignment): Adjust. (handle_pragma_push_options): Likewise. gcc/lto/ChangeLog: * lto-tree.h: Don't use variable_size gty attribute. * lto.c (lto_read_in_decl_state): Adjust. (create_subid_section_table): Likewise. (lto_flatten_files): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objcp/ChangeLog: * objcp-decl.h: Adjust. From-SVN: r210566
2014-05-18 01:07:23 +02:00
tmp_optabs = ggc_alloc<target_optabs> ();
/* Generate a new set of optabs into tmp_optabs. */
init_all_optabs (tmp_optabs);
/* If the optabs changed, record it. */
if (memcmp (tmp_optabs, this_target_optabs, sizeof (struct target_optabs)))
TREE_OPTIMIZATION_OPTABS (optnode) = tmp_optabs;
else
{
TREE_OPTIMIZATION_OPTABS (optnode) = NULL;
ggc_free (tmp_optabs);
}
}
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
/* A helper function for init_sync_libfuncs. Using the basename BASE,
install libfuncs into TAB for BASE_N for 1 <= N <= MAX. */
static void
init_sync_libfuncs_1 (optab tab, const char *base, int max)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
char buf[64];
size_t len = strlen (base);
int i;
gcc_assert (max <= 8);
gcc_assert (len + 3 < sizeof (buf));
memcpy (buf, base, len);
buf[len] = '_';
buf[len + 1] = '0';
buf[len + 2] = '\0';
mode = QImode;
for (i = 1; i <= max; i *= 2)
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
{
buf[len + 1] = '0' + i;
set_optab_libfunc (tab, mode, buf);
mode = GET_MODE_2XWIDER_MODE (mode);
}
}
void
init_sync_libfuncs (int max)
{
if (!flag_sync_libcalls)
return;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
init_sync_libfuncs_1 (sync_compare_and_swap_optab,
"__sync_val_compare_and_swap", max);
init_sync_libfuncs_1 (sync_lock_test_and_set_optab,
"__sync_lock_test_and_set", max);
init_sync_libfuncs_1 (sync_old_add_optab, "__sync_fetch_and_add", max);
init_sync_libfuncs_1 (sync_old_sub_optab, "__sync_fetch_and_sub", max);
init_sync_libfuncs_1 (sync_old_ior_optab, "__sync_fetch_and_or", max);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
init_sync_libfuncs_1 (sync_old_and_optab, "__sync_fetch_and_and", max);
init_sync_libfuncs_1 (sync_old_xor_optab, "__sync_fetch_and_xor", max);
init_sync_libfuncs_1 (sync_old_nand_optab, "__sync_fetch_and_nand", max);
init_sync_libfuncs_1 (sync_new_add_optab, "__sync_add_and_fetch", max);
init_sync_libfuncs_1 (sync_new_sub_optab, "__sync_sub_and_fetch", max);
init_sync_libfuncs_1 (sync_new_ior_optab, "__sync_or_and_fetch", max);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
init_sync_libfuncs_1 (sync_new_and_optab, "__sync_and_and_fetch", max);
init_sync_libfuncs_1 (sync_new_xor_optab, "__sync_xor_and_fetch", max);
init_sync_libfuncs_1 (sync_new_nand_optab, "__sync_nand_and_fetch", max);
}
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
/* Print information about the current contents of the optabs on
STDERR. */
tree-vrp.c (debug_value_range, [...]): Annotate with DEBUG_FUNCTION. * tree-vrp.c (debug_value_range, debug_all_value_ranges, debug_asserts_for, debug_all_asserts): Annotate with DEBUG_FUNCTION. * tree-into-ssa.c (debug_decl_set, debug_defs_stack, debug_currdefs, debug_tree_ssa, debug_tree_ssa_stats, debug_def_blocks, debug_names_replaced_by, debug_update_ssa): Likewise. * sbitmap.c (debug_sbitmap): Likewise. * genrecog.c (debug_decision, debug_decision_list): Likewise. * tree-pretty-print.c (debug_generic_expr, debug_generic_stmt, debug_tree_chain): Likewise. * tree-loop-distribution.c (debug_rdg_partitions): Likewise. * cgraph.c (debug_cgraph_node, debug_cgraph): Likewise. * optabs.c (debug_optab_libfuncs): Likewise. (verify_loop_closed_ssa): Likewise. * value-prof.c (verify_histograms): Likewise. * reload.c (debug_reload_to_stream, debug_reload): Likewise. * bitmap.c (debug_bitmap_file, debug_bitmap, bitmap_print): Likewise. * cfghooks.c (verify_flow_info): Likewise. * fold-const.c (debug_fold_checksum): Likewise. * omp-low.c (debug_omp_region, debug_all_omp_regions): Likewise. * cfg.c (debug_regset, debug_flow_info, debug_bb, debug_bb_n): Likewise. * omega.c (debug_omega_problem): Likewise. * cgraphunit.c (verify_cgraph_node, verify_cgraph): Likewise. * tree-ssa-ccp.c (debug_lattice_value): Likewise. * dominance.c (verify_dominators, debug_dominance_info, debug_dominance_tree): Likewise. * df-core.c (df_insn_uid_debug, df_insn_debug, df_insn_debug_regno, * df_regno_debug, df_ref_debug, debug_df_insn, debug_df_reg, debug_df_regno, debug_df_ref, debug_df_defno, debug_df_useno, debug_df_chain): Likewise. * tree-ssa-dom.c (debug_dominator_optimization_stats): Likewise. * sel-sched.c (debug_state): Likewise. * tree-ssa-alias.c (debug_alias_info, debug_points_to_info_for): Likewise. * cfganal.c (print_edge_list, verify_edge_list): Likewise. * dwarf2out.c (debug_dwarf_die, debug_dwarf): Likewise. * tree-eh.c (verify_eh_edges, verify_eh_dispatch_edge): Likewise. * gimple-pretty-print.c (debug_gimple_stmt, debug_gimple_seq): Likewise. * c-pretty-print.c (debug_c_tree): Likewise. * sel-sched-dump.c (debug_insn_rtx, debug_vinsn, debug_expr, debug_insn debug_av_set, debug_lv_set, debug_ilist, debug_blist, debug_insn_vector, debug_hard_reg_set, debug_mem_addr_value): Likewise. * ebitmap.c (debug_ebitmap): Likewise. * function.c (debug_find_var_in_block_tree): Likewise. * print-rtl.c (debug_rtx): Likewise. (debug_rtx_count): Likewise. (debug_rtx_list, debug_rtx_range, debug_rtx_find): Likewise. * stor-layout.c (debug_rli): Likewise. * ipa.c (debug_cgraph_node_set, debug_varpool_node_set): Likewise. * tree-data-ref.c (debug_data_references, debug_data_dependence_relations, debug_data_reference, debug_data_dependence_relation, debug_rdg_vertex, debug_rdg_component, debug_rdg): Likewise. * tree-affine.c (debug_aff): Likewise. * tree-dfa.c (debug_referenced_vars, debug_variable, debug_dfa_stats): Likewise. * except.c (debug_eh_tree, verify_eh_tree): Likewise. * emit-rtl.c (verify_rtl_sharing): Likewise. * tree-ssa-pre.c (debug_pre_expr, debug_bitmap_set, debug_value_expressions): Likewise. * tree-ssa-live.c (debug_scope_block, debug_scope_blocks): Likewise. * sese.c (debug_rename_map, debug_ivtype_map): Likewise. * print-tree.c (debug_tree, debug_vec_tree): Likewise. * cfglayout.c (verify_insn_chain): Likewise. * graphite-clast-to-gimple.c (debug_clast_name_indexes, debug_clast_stmt, debug_generated_program): Likewise. * ggc-page.c (debug_print_page_list): Likewise. * tree-ssa-ter.c (debug_ter): Likewise. * graphite-dependences.c (debug_pddr): Likewise. * sched-deps.c (debug_ds): Likewise. * tree-ssa.c (verify_ssa): Likewise. * graphite-poly.c (debug_scattering_function, debug_iteration_domain, debug_scattering_functions, debug_iteration_domains, debug_pdr, debug_pdrs, debug_pbb_domain, debug_pbb, debug_scop_context, debug_scop, debug_cloog, debug_scop_params, debug_lst): Likewise. * tree-inline.c (debug_find_tree): Likewise. * graphite-ppl.c (debug_ppl_linear_expr, debug_ppl_polyhedron_matrix, debug_ppl_powerset_matrix): Likewise. * var-tracking.c (debug_dv): Likewise. * system.h (DEBUG_FUNCTION, DEBUG_VARIABLE): Define. * cfgloop.c (verify_loop_structure): Likewise. * plugin.c (dump_active_plugins, debug_active_plugins): Likewise. * c-common.c (verify_sequence_points): Likewise. * sched-rgn.c (debug_regions, debug_region, debug_candidate, debug_candidates, debug_rgn_dependencies): Likewise. * tree-ssa-structalias.c (debug_constraint, debug_constraints, * debug_constraint_graph, debug_solution_for_var, debug_sa_points_to_info): Likewise. * sched-vis.c (debug_insn_slim, debug_bb_slim, debug_bb_n_slim): Likewie. * tree-cfg.c (debug_cfg_stats, verify_stmts, debug_function, debug_loops, debug_loop, debug_loop_num): Likewise. * passes.c (debug_pass): Likewise. (dump_properties): Likewise; add cfglayout property. (debug_properties): Likewise. * tree-ssa-reassoc.c (debug_ops_vector): Likewise. * varpool.c (debug_varpool): Likewise. * regcprop.c (debug_value_data): Likewise. * tree-ssa-operands.c (verify_imm_links, debug_immediate_uses, debug_immediate_uses_for): Likewise. From-SVN: r160036
2010-05-29 22:31:45 +02:00
DEBUG_FUNCTION void
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
debug_optab_libfuncs (void)
{
int i, j, k;
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
/* Dump the arithmetic optabs. */
for (i = FIRST_NORM_OPTAB; i <= LAST_NORMLIB_OPTAB; ++i)
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
for (j = 0; j < NUM_MACHINE_MODES; ++j)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
rtx l = optab_libfunc ((optab) i, (machine_mode) j);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (l)
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gcc_assert (GET_CODE (l) == SYMBOL_REF);
fprintf (stderr, "%s\t%s:\t%s\n",
GET_RTX_NAME (optab_to_code ((optab) i)),
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
GET_MODE_NAME (j),
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
XSTR (l, 0));
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
}
}
/* Dump the conversion optabs. */
for (i = FIRST_CONV_OPTAB; i <= LAST_CONVLIB_OPTAB; ++i)
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
for (j = 0; j < NUM_MACHINE_MODES; ++j)
for (k = 0; k < NUM_MACHINE_MODES; ++k)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
rtx l = convert_optab_libfunc ((optab) i, (machine_mode) j,
(machine_mode) k);
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
if (l)
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
{
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
gcc_assert (GET_CODE (l) == SYMBOL_REF);
fprintf (stderr, "%s\t%s\t%s:\t%s\n",
GET_RTX_NAME (optab_to_code ((optab) i)),
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
GET_MODE_NAME (j),
GET_MODE_NAME (k),
optabs.c (debug_optab_libfunc): Update; make available to gdb. * optabs.c (debug_optab_libfunc): Update; make available to gdb. (libfunc_entry): New structure. (libfunc_hash): New hashtable. (hash_libfunc): New function. (eq_libfunc): New function. (convert_optab_libfunc): New function. (optab_libfunc): New function. (expand_binop, sign_expand_binop, expand_twoval_binop_libfunc, expand_unop, prepare_cmp_insn, prepare_float_insn, gen_add2_insn, expand_float, expand_fix, new_optab, new_convert_optab): Update for new libfunc API. (init_libfunc, init_integral_libfuncs, init_floating_libfuncs, init_interclass_conv_libfuncs init_intraclass_conv_libfuncs): Remove; reorganize all logic to: (gen_libfunc, gen_int_libfunc, gen_fp_libfunc, gen_int_fp_libfunc, gen_intv_fp_libfunc, gen_interclass_conv_libfunc, gen_int_to_fp_conv_libfunc, gen_ufloat_conv_libfunc, gen_int_to_fp_nondecimal_conv_libfunc, gen_fp_to_int_conv_libfunc, gen_intraclass_conv_libfunc, gen_trunc_conv_libfunc, gen_extend_conv_libfunc): New. (init_one_libfunc): Revamp for hashtables. (set_conv_libfunc): Likewise. (init_optabs): Initialize hashtable; use lazy initialization where possible. * optabs.h (optab_handlers): Move out of GGC. (optab, convert_optab): Move out of GGC; add lazy gen info. (code_to_optab, convert_optab_table, optab_table): Move out of GGC. (optab_libfunc, convert_optab_libfunc): New. * builtins.c (expand_builtin_powi): Update for new API. * expr.c (convert_move): Likewise. * expmed.c (expand_divmod): Likewise. From-SVN: r128083
2007-09-04 16:03:31 +02:00
XSTR (l, 0));
configure.in (arm*-*-eabi*): New target. * configure.in (arm*-*-eabi*): New target. * configure: Regenerate. * configure.ac (arm*-*-eabi*): New target. (arm*-*-symbianelf*): Likewise. * configure: Regenerated. * config.gcc (arm*-*-eabi*): New target. * defaults.h (TARGET_LIBGCC_FUNCS): New macro. (TARGET_LIB_INT_CMP_BIASED): Likewise. * expmed.c (expand_divmod): Try a two-valued divmod function as a last resort. * gthr.h: Remove bogus tokens at end of #pragma. * optabs.c (expand_twoval_binop_libfunc): New function. (prepare_cmp_insn): Handle the !TARGET_LIB_INT_CMP_BIASED case. (prepare_float_lib_cmp): Try reversing the condition. (debug_optab_libfuncs): New function. * optabs.h (expand_twoval_binop_libfunc): Declare. * config/arm/arm.c (arm_init_libfuncs): New function. (arm_compute_initial_eliminatino_offset): Return HOST_WIDE_INT. (TARGET_INIT_LIBFUNCS): Define it. * config/arm/arm.h (TARGET_BPABI): New macro. * config/arm/arm-protos.h (arm_compute_initial_elimination_offset): Return HOST_WIDE_INT. * config/arm/bpabi.S: New file. * config/arm/bpabi.c: Likewise. * config/arm/bpabi.h: Likewise. * config/arm/ieee754-df.S (__aeabi_dneg): New function or alias. (__aeabi_drsub): Likewise. (__aeabi_dsub): Likewise. (__aeabi_dadd): Likewise. (__aeabi_ui2d): Likewise. (__aeabi_i2d): Likewise. (__aeabi_f2d): Likewise. (__aeabi_dmul): Likewise. (__aeabi_ddiv): Likewise. (__aeabi_cdrcmple): Likewise. (__aeabi_cdcmpeq): Likewise. (__aeabi_cdcmple): Likewise. (__aeabi_dcmpeq): Likewise. (__aeabi_dcmplt): Likewise. (__aeabi_dcmple): Likewise. (__aeabi_dcmpge): Likewise. (__aeabi_dcmpgt): Likewise. (__aeabi_dcmpun): Likewise. (__aeabi_d2iz): Likewise. (__aeabi_d2uiz): Likewise. (__aeabi_d2f): Likewise. * config/arm/ieee754-sf.S (__aeabi_fneg): New function or alias. (__aeabi_frsub): Likewise. (__aeabi_fsub): Likewise. (__aeabi_fadd): Likewise. (__aeabi_ui2f): Likewise. (__aeabi_i2f): Likewise. (__aeabi_fmul): Likewise. (__aeabi_fdiv): Likewise. (__aeabi_cfrcmple): Likewise. (__aeabi_cfcmpeq): Likewise. (__aeabi_cfcmple): Likewise. (__aeabi_fcmpeq): Likewise. (__aeabi_fcmplt): Likewise. (__aeabi_fcmple): Likewise. (__aeabi_fcmpge): Likewise. (__aeabi_fcmpgt): Likewise. (__aeabi_fcmpun): Likewise. (__aeabi_f2iz): Likewise. (__aeabi_f2uiz): Likewise. * config/arm/lib1funcs.asm (ARM_CALL): New macro. (__aeabi_uidivmod): New function or alias. (__aeabi_idivmod): Likewise. (__aeabi_idiv0): Likewise. (__aeabi_ldiv0): Likewise. (__aeabi_llsr): Likewise. (__aeabi_lasr): Likewise. (__aeabi_llsl): Likewise. (bpabi.S): Include it. * config/arm/libgcc-bpabi.ver: New file. * config/arm/symbian.h (ARM_DEFAULT_ABI): Remove. (LINK_SPEC): Remove. * config/arm/t-arm-elf (LIB1ASMFUNCS): Add __aeabi_lcmp and __aeabi_ulcmp. * config/arm/t-bpabi: New file. * doc/tm.texi (TARGET_LIBGCC_FUNCS): New entry. (TARGET_LIB_INT_CMP_BIASED): Likewise. * gcc.dg/testsuite/gcc.dg/arm-eabi1.c: New test. * gcc.dg/dll-2.c: Fix dg-require syntax. * gcc.misc-tests/arm-isr.c (abort): Declare. (exit): Likewise. From-SVN: r85788
2004-08-11 04:50:14 +02:00
}
}
}
/* Generate insns to trap with code TCODE if OP1 and OP2 satisfy condition
CODE. Return 0 on failure. */
rtx_insn *
gen_cond_trap (enum rtx_code code, rtx op1, rtx op2, rtx tcode)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (op1);
enum insn_code icode;
rtx_insn *insn;
rtx trap_rtx;
if (mode == VOIDmode)
return 0;
icode = optab_handler (ctrap_optab, mode);
if (icode == CODE_FOR_nothing)
return 0;
/* Some targets only accept a zero trap code. */
if (!insn_operand_matches (icode, 3, tcode))
return 0;
do_pending_stack_adjust ();
start_sequence ();
prepare_cmp_insn (op1, op2, code, NULL_RTX, false, OPTAB_DIRECT,
&trap_rtx, &mode);
if (!trap_rtx)
insn = NULL;
else
insn = GEN_FCN (icode) (trap_rtx, XEXP (trap_rtx, 0), XEXP (trap_rtx, 1),
tcode);
/* If that failed, then give up. */
if (insn == 0)
{
end_sequence ();
return 0;
}
emit_insn (insn);
insn = get_insns ();
end_sequence ();
return insn;
}
/* Return rtx code for TCODE. Use UNSIGNEDP to select signed
or unsigned operation code. */
enum rtx_code
get_rtx_code (enum tree_code tcode, bool unsignedp)
{
enum rtx_code code;
switch (tcode)
{
case EQ_EXPR:
code = EQ;
break;
case NE_EXPR:
code = NE;
break;
case LT_EXPR:
code = unsignedp ? LTU : LT;
break;
case LE_EXPR:
code = unsignedp ? LEU : LE;
break;
case GT_EXPR:
code = unsignedp ? GTU : GT;
break;
case GE_EXPR:
code = unsignedp ? GEU : GE;
break;
case UNORDERED_EXPR:
code = UNORDERED;
break;
case ORDERED_EXPR:
code = ORDERED;
break;
case UNLT_EXPR:
code = UNLT;
break;
case UNLE_EXPR:
code = UNLE;
break;
case UNGT_EXPR:
code = UNGT;
break;
case UNGE_EXPR:
code = UNGE;
break;
case UNEQ_EXPR:
code = UNEQ;
break;
case LTGT_EXPR:
code = LTGT;
break;
case BIT_AND_EXPR:
code = AND;
break;
case BIT_IOR_EXPR:
code = IOR;
break;
default:
gcc_unreachable ();
}
return code;
}
/* Return comparison rtx for COND. Use UNSIGNEDP to select signed or
unsigned operators. Do not generate compare instruction. */
static rtx
vector_compare_rtx (enum tree_code tcode, tree t_op0, tree t_op1,
bool unsignedp, enum insn_code icode)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[2];
rtx rtx_op0, rtx_op1;
machine_mode m0, m1;
enum rtx_code rcode = get_rtx_code (tcode, unsignedp);
gcc_assert (TREE_CODE_CLASS (tcode) == tcc_comparison);
/* Expand operands. For vector types with scalar modes, e.g. where int64x1_t
has mode DImode, this can produce a constant RTX of mode VOIDmode; in such
cases, use the original mode. */
builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). * builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_mathfn_3): Ditto. (expand_builtin_interclass_mathfn): Ditto. (expand_builtin_cexpi): Ditto. (expand_builtin_int_roundingfn): Ditto. (expand_builtin_int_roundingfn_2): Ditto. (expand_builtin_pow): Ditto. (expand_builtin_powi): Ditto. (expand_builtin_bswap): Ditto. (expand_builtin_unop): Ditto. (expand_builtin_fabs): Ditto. (get_builtin_sync_mem): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_builtin_sync_operation): Ditto. (expand_builtin_compare_and_swap): Ditto. (expand_builtin_lock_test_and_set): Ditto. * except.c (expand_builtin_eh_return_data_regno): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_extract_return_addr): Ditto. (expand_builtin_eh_return): Ditto. (expand_eh_return): Ditto. * explow.c (expr_size): Ditto. * expr.c (optimize_bitfield_assignment_op): Ditto. (expand_assignement): Ditto. (store_expr): Ditto. (store_field): Ditto. (expand_expr_addr_expr_1): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_expr_real_1) [COMPLEX_CST]: Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). [CONSTRUCTOR, PLUS_EXPR, MINUS_EXPR, NEGATE_EXPR, ABS_EXPR, BIT_NOT_EXPR, LSHIFT_EXPR, LT_EXPR, TRUTH_NOT_EXPR]: Ditto. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO]: Use expand_normal() instead of expand_expr(). * optabs.c (expand_vec_shift_expr): Ditto. (expand_vec_cond_expr): Ditto. (vector_compare_rtx): Use EXPAND_STACK_PARM instead of 1 in the call to expand_expr(). * stmt.c (expand_return): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). From-SVN: r124722
2007-05-14 21:42:47 +02:00
rtx_op0 = expand_expr (t_op0, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op0)),
EXPAND_STACK_PARM);
m0 = GET_MODE (rtx_op0);
if (m0 == VOIDmode)
m0 = TYPE_MODE (TREE_TYPE (t_op0));
builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). * builtins.c (expand_builtin_mathfn): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_mathfn_3): Ditto. (expand_builtin_interclass_mathfn): Ditto. (expand_builtin_cexpi): Ditto. (expand_builtin_int_roundingfn): Ditto. (expand_builtin_int_roundingfn_2): Ditto. (expand_builtin_pow): Ditto. (expand_builtin_powi): Ditto. (expand_builtin_bswap): Ditto. (expand_builtin_unop): Ditto. (expand_builtin_fabs): Ditto. (get_builtin_sync_mem): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_builtin_sync_operation): Ditto. (expand_builtin_compare_and_swap): Ditto. (expand_builtin_lock_test_and_set): Ditto. * except.c (expand_builtin_eh_return_data_regno): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). (expand_builtin_extract_return_addr): Ditto. (expand_builtin_eh_return): Ditto. (expand_eh_return): Ditto. * explow.c (expr_size): Ditto. * expr.c (optimize_bitfield_assignment_op): Ditto. (expand_assignement): Ditto. (store_expr): Ditto. (store_field): Ditto. (expand_expr_addr_expr_1): Use NULL_RTX instead of NULL in the call to expand_expr(). (expand_expr_real_1) [COMPLEX_CST]: Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). [CONSTRUCTOR, PLUS_EXPR, MINUS_EXPR, NEGATE_EXPR, ABS_EXPR, BIT_NOT_EXPR, LSHIFT_EXPR, LT_EXPR, TRUTH_NOT_EXPR]: Ditto. [VEC_UNPACK_HI_EXPR, VEC_UNPACK_LO]: Use expand_normal() instead of expand_expr(). * optabs.c (expand_vec_shift_expr): Ditto. (expand_vec_cond_expr): Ditto. (vector_compare_rtx): Use EXPAND_STACK_PARM instead of 1 in the call to expand_expr(). * stmt.c (expand_return): Use EXPAND_NORMAL instead of 0 in the call to expand_expr(). From-SVN: r124722
2007-05-14 21:42:47 +02:00
rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)),
EXPAND_STACK_PARM);
m1 = GET_MODE (rtx_op1);
if (m1 == VOIDmode)
m1 = TYPE_MODE (TREE_TYPE (t_op1));
create_input_operand (&ops[0], rtx_op0, m0);
create_input_operand (&ops[1], rtx_op1, m1);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (!maybe_legitimize_operands (icode, 4, 2, ops))
gcc_unreachable ();
return gen_rtx_fmt_ee (rcode, VOIDmode, ops[0].value, ops[1].value);
}
/* Return true if VEC_PERM_EXPR of arbitrary input vectors can be expanded using
SIMD extensions of the CPU. SEL may be NULL, which stands for an unknown
constant. Note that additional permutations representing whole-vector shifts
may also be handled via the vec_shr optab, but only where the second input
vector is entirely constant zeroes; this case is not dealt with here. */
bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_vec_perm_p (machine_mode mode, bool variable,
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
const unsigned char *sel)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode qimode;
/* If the target doesn't implement a vector mode for the vector type,
then no operations are supported. */
if (!VECTOR_MODE_P (mode))
return false;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (!variable)
{
if (direct_optab_handler (vec_perm_const_optab, mode) != CODE_FOR_nothing
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
&& (sel == NULL
|| targetm.vectorize.vec_perm_const_ok == NULL
|| targetm.vectorize.vec_perm_const_ok (mode, sel)))
return true;
}
if (direct_optab_handler (vec_perm_optab, mode) != CODE_FOR_nothing)
return true;
/* We allow fallback to a QI vector mode, and adjust the mask. */
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (GET_MODE_INNER (mode) == QImode)
return false;
qimode = mode_for_vector (QImode, GET_MODE_SIZE (mode));
if (!VECTOR_MODE_P (qimode))
return false;
/* ??? For completeness, we ought to check the QImode version of
vec_perm_const_optab. But all users of this implicit lowering
feature implement the variable vec_perm_optab. */
if (direct_optab_handler (vec_perm_optab, qimode) == CODE_FOR_nothing)
return false;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
/* In order to support the lowering of variable permutations,
we need to support shifts and adds. */
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (variable)
{
if (GET_MODE_UNIT_SIZE (mode) > 2
&& optab_handler (ashl_optab, mode) == CODE_FOR_nothing
&& optab_handler (vashl_optab, mode) == CODE_FOR_nothing)
return false;
if (optab_handler (add_optab, qimode) == CODE_FOR_nothing)
return false;
}
return true;
}
/* Checks if vec_perm mask SEL is a constant equivalent to a shift of the first
vec_perm operand, assuming the second operand is a constant vector of zeroes.
Return the shift distance in bits if so, or NULL_RTX if the vec_perm is not a
shift. */
static rtx
shift_amt_for_vec_perm_mask (rtx sel)
{
unsigned int i, first, nelt = GET_MODE_NUNITS (GET_MODE (sel));
unsigned int bitsize = GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (sel)));
if (GET_CODE (sel) != CONST_VECTOR)
return NULL_RTX;
first = INTVAL (CONST_VECTOR_ELT (sel, 0));
if (first >= 2*nelt)
return NULL_RTX;
for (i = 1; i < nelt; i++)
{
int idx = INTVAL (CONST_VECTOR_ELT (sel, i));
unsigned int expected = (i + first) & (2 * nelt - 1);
/* Indices into the second vector are all equivalent. */
if (idx < 0 || (MIN (nelt, (unsigned) idx) != MIN (nelt, expected)))
return NULL_RTX;
}
return GEN_INT (first * bitsize);
}
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
/* A subroutine of expand_vec_perm for expanding one vec_perm insn. */
static rtx
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
expand_vec_perm_1 (enum insn_code icode, rtx target,
rtx v0, rtx v1, rtx sel)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode tmode = GET_MODE (target);
machine_mode smode = GET_MODE (sel);
struct expand_operand ops[4];
create_output_operand (&ops[0], target, tmode);
create_input_operand (&ops[3], sel, smode);
/* Make an effort to preserve v0 == v1. The target expander is able to
rely on this to determine if we're permuting a single input operand. */
if (rtx_equal_p (v0, v1))
{
if (!insn_operand_matches (icode, 1, v0))
v0 = force_reg (tmode, v0);
gcc_checking_assert (insn_operand_matches (icode, 1, v0));
gcc_checking_assert (insn_operand_matches (icode, 2, v0));
create_fixed_operand (&ops[1], v0);
create_fixed_operand (&ops[2], v0);
}
else
{
create_input_operand (&ops[1], v0, tmode);
/* See if this can be handled with a vec_shr. We only do this if the
second vector is all zeroes. */
enum insn_code shift_code = optab_handler (vec_shr_optab, GET_MODE (v0));
if (v1 == CONST0_RTX (GET_MODE (v1)) && shift_code)
if (rtx shift_amt = shift_amt_for_vec_perm_mask (sel))
{
create_convert_operand_from_type (&ops[2], shift_amt,
sizetype_tab[(int) stk_sizetype]);
if (maybe_expand_insn (shift_code, 3, ops))
return ops[0].value;
}
create_input_operand (&ops[2], v1, tmode);
}
if (maybe_expand_insn (icode, 4, ops))
return ops[0].value;
return NULL_RTX;
}
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
/* Generate instructions for vec_perm optab given its mode
and three operands. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_vec_perm (machine_mode mode, rtx v0, rtx v1, rtx sel, rtx target)
{
enum insn_code icode;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode qimode;
unsigned int i, w, e, u;
rtx tmp, sel_qi = NULL;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
rtvec vec;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (!target || GET_MODE (target) != mode)
target = gen_reg_rtx (mode);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
w = GET_MODE_SIZE (mode);
e = GET_MODE_NUNITS (mode);
u = GET_MODE_UNIT_SIZE (mode);
/* Set QIMODE to a different vector mode with byte elements.
If no such mode, or if MODE already has byte elements, use VOIDmode. */
qimode = VOIDmode;
if (GET_MODE_INNER (mode) != QImode)
{
qimode = mode_for_vector (QImode, w);
if (!VECTOR_MODE_P (qimode))
qimode = VOIDmode;
}
/* If the input is a constant, expand it specially. */
gcc_assert (GET_MODE_CLASS (GET_MODE (sel)) == MODE_VECTOR_INT);
if (GET_CODE (sel) == CONST_VECTOR)
{
icode = direct_optab_handler (vec_perm_const_optab, mode);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (icode != CODE_FOR_nothing)
{
tmp = expand_vec_perm_1 (icode, target, v0, v1, sel);
if (tmp)
return tmp;
}
/* Fall back to a constant byte-based permutation. */
if (qimode != VOIDmode)
{
vec = rtvec_alloc (w);
for (i = 0; i < e; ++i)
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
{
unsigned int j, this_e;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
this_e = INTVAL (CONST_VECTOR_ELT (sel, i));
this_e &= 2 * e - 1;
this_e *= u;
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
for (j = 0; j < u; ++j)
RTVEC_ELT (vec, i * u + j) = GEN_INT (this_e + j);
}
sel_qi = gen_rtx_CONST_VECTOR (qimode, vec);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
icode = direct_optab_handler (vec_perm_const_optab, qimode);
if (icode != CODE_FOR_nothing)
{
tmp = mode != qimode ? gen_reg_rtx (qimode) : target;
tmp = expand_vec_perm_1 (icode, tmp, gen_lowpart (qimode, v0),
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
gen_lowpart (qimode, v1), sel_qi);
if (tmp)
return gen_lowpart (mode, tmp);
}
}
}
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
/* Otherwise expand as a fully variable permuation. */
icode = direct_optab_handler (vec_perm_optab, mode);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (icode != CODE_FOR_nothing)
{
tmp = expand_vec_perm_1 (icode, target, v0, v1, sel);
if (tmp)
return tmp;
}
/* As a special case to aid several targets, lower the element-based
permutation to a byte-based permutation and try again. */
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (qimode == VOIDmode)
return NULL_RTX;
icode = direct_optab_handler (vec_perm_optab, qimode);
if (icode == CODE_FOR_nothing)
return NULL_RTX;
if (sel_qi == NULL)
{
/* Multiply each element by its byte size. */
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode selmode = GET_MODE (sel);
if (u == 2)
sel = expand_simple_binop (selmode, PLUS, sel, sel,
NULL, 0, OPTAB_DIRECT);
else
sel = expand_simple_binop (selmode, ASHIFT, sel,
GEN_INT (exact_log2 (u)),
NULL, 0, OPTAB_DIRECT);
gcc_assert (sel != NULL);
/* Broadcast the low byte each element into each of its bytes. */
vec = rtvec_alloc (w);
for (i = 0; i < w; ++i)
{
int this_e = i / u * u;
if (BYTES_BIG_ENDIAN)
this_e += u - 1;
RTVEC_ELT (vec, i) = GEN_INT (this_e);
}
tmp = gen_rtx_CONST_VECTOR (qimode, vec);
sel = gen_lowpart (qimode, sel);
sel = expand_vec_perm (qimode, sel, sel, tmp, NULL);
gcc_assert (sel != NULL);
/* Add the byte offset to each byte element. */
/* Note that the definition of the indicies here is memory ordering,
so there should be no difference between big and little endian. */
vec = rtvec_alloc (w);
for (i = 0; i < w; ++i)
RTVEC_ELT (vec, i) = GEN_INT (i % u);
tmp = gen_rtx_CONST_VECTOR (qimode, vec);
sel_qi = expand_simple_binop (qimode, PLUS, sel, tmp,
sel, 0, OPTAB_DIRECT);
gcc_assert (sel_qi != NULL);
}
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
tmp = mode != qimode ? gen_reg_rtx (qimode) : target;
tmp = expand_vec_perm_1 (icode, tmp, gen_lowpart (qimode, v0),
gen_lowpart (qimode, v1), sel_qi);
Change vec_perm checking and expansion level. The can_vec_perm_p interface changed to use a C integer array. This allows easy re-use from the rtl level and the gimple level within the vectorizer. It allows both to determine if a given permutation is (un-)supported without having to create tree/rtl garbage. The expand_vec_perm interface changed to use rtl. This allows easy re-use from the rtl level, so that expand_vec_perm can be used in the fallback implementation of other optabs. * target.def (vec_perm_const_ok): Change parameters to mode and array of indicies. * doc/tm.texi: Rebuild. * config/i386/i386.c (ix86_vectorize_vec_perm_const_ok): Change parameters to mode and array of indicies. * expr.c (expand_expr_real_2) [VEC_PERM_EXPR]: Expand operands here. * optabs.c (can_vec_perm_p): Rename from can_vec_perm_expr_p. Change parameters to mode and array of indicies. (expand_vec_perm_1): Rename from expand_vec_perm_expr_1. (expand_vec_perm): Rename from expand_vec_perm_expr. Change parameters to mode and rtx inputs. Try lowering to QImode vec_perm_const before trying fully variable permutation. * optabs.h: Update decls. * tree-vect-generic.c (lower_vec_perm): Extract array of indices from VECTOR_CST to pass to can_vec_perm_p. * tree-vect-slp.c (vect_get_mask_element): Change mask parameter type from int pointer to unsigned char pointer. (vect_transform_slp_perm_load): Update for change to can_vec_perm_p. * tree-vect-stmts.c (perm_mask_for_reverse): Likewise. From-SVN: r180449
2011-10-25 23:29:48 +02:00
if (tmp)
tmp = gen_lowpart (mode, tmp);
return tmp;
}
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
/* Return insn code for a conditional operator with a comparison in
mode CMODE, unsigned if UNS is true, resulting in a value of mode VMODE. */
static inline enum insn_code
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
get_vcond_icode (machine_mode vmode, machine_mode cmode, bool uns)
{
enum insn_code icode = CODE_FOR_nothing;
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
if (uns)
icode = convert_optab_handler (vcondu_optab, vmode, cmode);
else
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
icode = convert_optab_handler (vcond_optab, vmode, cmode);
return icode;
}
/* Return TRUE iff, appropriate vector insns are available
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
for vector cond expr with vector type VALUE_TYPE and a comparison
with operand vector types in CMP_OP_TYPE. */
bool
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
expand_vec_cond_expr_p (tree value_type, tree cmp_op_type)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode value_mode = TYPE_MODE (value_type);
machine_mode cmp_op_mode = TYPE_MODE (cmp_op_type);
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
if (GET_MODE_SIZE (value_mode) != GET_MODE_SIZE (cmp_op_mode)
|| GET_MODE_NUNITS (value_mode) != GET_MODE_NUNITS (cmp_op_mode)
|| get_vcond_icode (TYPE_MODE (value_type), TYPE_MODE (cmp_op_type),
TYPE_UNSIGNED (cmp_op_type)) == CODE_FOR_nothing)
return false;
return true;
}
/* Generate insns for a VEC_COND_EXPR, given its TYPE and its
three operands. */
rtx
expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2,
rtx target)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
struct expand_operand ops[6];
enum insn_code icode;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
rtx comparison, rtx_op1, rtx_op2;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = TYPE_MODE (vec_cond_type);
machine_mode cmp_op_mode;
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
bool unsignedp;
tree op0a, op0b;
enum tree_code tcode;
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
if (COMPARISON_CLASS_P (op0))
{
op0a = TREE_OPERAND (op0, 0);
op0b = TREE_OPERAND (op0, 1);
tcode = TREE_CODE (op0);
}
else
{
/* Fake op0 < 0. */
gcc_assert (!TYPE_UNSIGNED (TREE_TYPE (op0)));
op0a = op0;
op0b = build_zero_cst (TREE_TYPE (op0));
tcode = LT_EXPR;
}
unsignedp = TYPE_UNSIGNED (TREE_TYPE (op0a));
cmp_op_mode = TYPE_MODE (TREE_TYPE (op0a));
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
gcc_assert (GET_MODE_SIZE (mode) == GET_MODE_SIZE (cmp_op_mode)
&& GET_MODE_NUNITS (mode) == GET_MODE_NUNITS (cmp_op_mode));
re PR tree-optimization/27460 (Does not vectorize statements with mixed type COND_EXPRs) 2011-09-02 Richard Guenther <rguenther@suse.de> PR tree-optimization/27460 PR middle-end/29269 * doc/md.texi (vcond): Document. * genopinit.c (optabs): Turn vcond{,u}_optab into a conversion optab with two modes. * optabs.h (enum convert_optab_index): Add COI_vcond, COI_vcondu. (enum direct_optab_index): Remove DOI_vcond, DOI_vcondu. (vcond_optab): Adjust. (vcondu_optab): Likewise. (expand_vec_cond_expr_p): Adjust prototype. * optabs.c (get_vcond_icode): Adjust. (expand_vec_cond_expr_p): Likewise. (expand_vec_cond_expr): Likewise. * tree-vect-stmts.c (vect_is_simple_cond): Return the comparison vector type. (vectorizable_condition): Allow differing types for comparison and result. * config/i386/i386.c (ix86_expand_sse_cmp): Use proper mode for the comparison. * config/i386/sse.md (vcond<mode>): Split to vcond<V_256:mode><VF_256:mode>, vcond<V_128:mode><VF_128:mode>, vcond<V_128:mode><VI124_128:mode> and vcondu<V_128:mode><VI124_128:mode>. (vcondv2di): Change to vcond<VI8F_128:mode>v2di. (vconduv2di): Likewise. * config/arm/neon.md (vcond<mode>): Change to vcond*<mode><mode>. (vcondu<mode>): Likewise. * config/ia64/vect.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. (vcondv2sf): Likewise. * config/mips/mips-ps-3d.md (vcondv2sf): Likewise. * config/rs6000/paired.md (vcondv2sf): Likewise. * config/rs6000/vector.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * config/spu/spu.md (vcond<mode>): Likewise. (vcondu<mode>): Likewise. * gcc.dg/vect/vect-cond-7.c: New testcase. From-SVN: r178480
2011-09-02 15:53:32 +02:00
icode = get_vcond_icode (mode, cmp_op_mode, unsignedp);
if (icode == CODE_FOR_nothing)
return 0;
comparison = vector_compare_rtx (tcode, op0a, op0b, unsignedp, icode);
rtx_op1 = expand_normal (op1);
rtx_op2 = expand_normal (op2);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_output_operand (&ops[0], target, mode);
create_input_operand (&ops[1], rtx_op1, mode);
create_input_operand (&ops[2], rtx_op2, mode);
create_fixed_operand (&ops[3], comparison);
create_fixed_operand (&ops[4], XEXP (comparison, 0));
create_fixed_operand (&ops[5], XEXP (comparison, 1));
expand_insn (icode, 6, ops);
return ops[0].value;
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Return non-zero if a highpart multiply is supported of can be synthisized.
For the benefit of expand_mult_highpart, the return value is 1 for direct,
2 for even/odd widening, and 3 for hi/lo widening. */
int
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_mult_highpart_p (machine_mode mode, bool uns_p)
{
optab op;
unsigned char *sel;
unsigned i, nunits;
op = uns_p ? umul_highpart_optab : smul_highpart_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
return 1;
/* If the mode is an integral vector, synth from widening operations. */
if (GET_MODE_CLASS (mode) != MODE_VECTOR_INT)
return 0;
nunits = GET_MODE_NUNITS (mode);
sel = XALLOCAVEC (unsigned char, nunits);
op = uns_p ? vec_widen_umult_even_optab : vec_widen_smult_even_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
op = uns_p ? vec_widen_umult_odd_optab : vec_widen_smult_odd_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
for (i = 0; i < nunits; ++i)
sel[i] = !BYTES_BIG_ENDIAN + (i & ~1) + ((i & 1) ? nunits : 0);
if (can_vec_perm_p (mode, false, sel))
return 2;
}
}
op = uns_p ? vec_widen_umult_hi_optab : vec_widen_smult_hi_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
op = uns_p ? vec_widen_umult_lo_optab : vec_widen_smult_lo_optab;
if (optab_handler (op, mode) != CODE_FOR_nothing)
{
for (i = 0; i < nunits; ++i)
sel[i] = 2 * i + (BYTES_BIG_ENDIAN ? 0 : 1);
if (can_vec_perm_p (mode, false, sel))
return 3;
}
}
return 0;
}
/* Expand a highpart multiply. */
rtx
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
expand_mult_highpart (machine_mode mode, rtx op0, rtx op1,
rtx target, bool uns_p)
{
struct expand_operand eops[3];
enum insn_code icode;
int method, i, nunits;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode wmode;
rtx m1, m2, perm;
optab tab1, tab2;
rtvec v;
method = can_mult_highpart_p (mode, uns_p);
switch (method)
{
case 0:
return NULL_RTX;
case 1:
tab1 = uns_p ? umul_highpart_optab : smul_highpart_optab;
return expand_binop (mode, tab1, op0, op1, target, uns_p,
OPTAB_LIB_WIDEN);
case 2:
tab1 = uns_p ? vec_widen_umult_even_optab : vec_widen_smult_even_optab;
tab2 = uns_p ? vec_widen_umult_odd_optab : vec_widen_smult_odd_optab;
break;
case 3:
tab1 = uns_p ? vec_widen_umult_lo_optab : vec_widen_smult_lo_optab;
tab2 = uns_p ? vec_widen_umult_hi_optab : vec_widen_smult_hi_optab;
if (BYTES_BIG_ENDIAN)
Use std::swap instead of manual swaps. gcc/ * auto-inc-dec.c (reverse_mem, reverse_inc): Remove. (parse_add_or_inc): Use std::swap instead of reverse_{mem,inc}. (find_inc): Likewise. * combine.c (combine_simplify_rtx): Use std::swap instead of manually swapping. * df-core.c (df_worklist_dataflow_doublequeue): Likewise. * df-scan.c (df_swap_refs): Remove. (df_sort_and_compress_refs): Use std::swap instead of df_swap_refs. * dominance.c (link_roots): Use std::swap instead of manually swapping. * expr.c (expand_expr_real_2, do_store_flag): Likewise. * fold-const.c (fold_relational_const): Likewise. * genattrtab.c (simplify_test_exp): Likewise. * gimple-match-head.c (gimple_resimplify2, gimple_resimplify3, gimple_simplify): Likewise. * ifcvt.c (noce_try_abs, find_if_header): Likewise. * internal-fn.c (expand_addsub_overflow, expand_mul_overflow): Likewise. * ipa-devirt.c (add_type_duplicate): Likewise. * loop-iv.c (get_biv_step_1, iv_number_of_iterations): Likewise. * lra-lives.c (lra_setup_reload_pseudo_preferenced_hard_reg): Likewise. * lra.c (lra_create_copy): Likewise. * lto-streamer-out.c (DFS::DFS): Likewise. * modulo-sched.c (get_sched_window): Likewise. * omega.c (omega_pretty_print_problem): Likewise. * optabs.c (prepare_float_lib_cmp, expand_mult_highpart): Likewise. * reload1.c (reloads_unique_chain_p): Likewise. * sel-sched-ir.c (exchange_lv_sets, exchange_av_sets): Remove. (exchange_data_sets): Move logic from exchange_{av,lv}_sets here and use std::swap. * simplify-rtx.c (simplify_unary_operation_1): Use std::swap instead of manually swapping. * tree-if-conv.c (is_cond_scalar_reduction, predicate_scalar_phi, predicate_mem_writes): Likewise. * tree-loop-distribution.c (pg_add_dependence_edges): Likewise. * tree-predcom.c (combine_chains): Likewise. * tree-ssa-alias.c (nonoverlapping_component_refs_p, refs_may_alias_p_1): Likewise. * tree-ssa-ifcombine.c (recognize_if_then_else): Likewise. * tree-ssa-loop-ivopts.c (extract_cond_operands): Likewise. * tree-ssa-loop-niter.c (refine_bounds_using_guard, number_of_iterations_cond): Likewise. * tree-ssa-phiopt.c (tree_ssa_phiopt_worker): Likewise. * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise. * tree-vect-slp.c (vect_build_slp_tree): Likewise. * tree-vect-stmts.c (supportable_widening_operation): Likewise. * tree-vrp.c (extract_range_from_binary_expr_1, extract_range_from_unary_expr_1): Likewise. gcc/cp/ * pt.c (maybe_adjust_types_for_deduction): Use std::swap instead of manually swapping. * semantics.c (finish_omp_atomic): Likewise. * typeck.c (cp_build_array_ref): Likewise. gcc/c-family/ * c-common.c (scalar_to_vector): Use std::swap instead of manually swapping. From-SVN: r224718
2015-06-22 04:54:11 +02:00
std::swap (tab1, tab2);
break;
default:
gcc_unreachable ();
}
icode = optab_handler (tab1, mode);
nunits = GET_MODE_NUNITS (mode);
wmode = insn_data[icode].operand[0].mode;
gcc_checking_assert (2 * GET_MODE_NUNITS (wmode) == nunits);
gcc_checking_assert (GET_MODE_SIZE (wmode) == GET_MODE_SIZE (mode));
create_output_operand (&eops[0], gen_reg_rtx (wmode), wmode);
create_input_operand (&eops[1], op0, mode);
create_input_operand (&eops[2], op1, mode);
expand_insn (icode, 3, eops);
m1 = gen_lowpart (mode, eops[0].value);
create_output_operand (&eops[0], gen_reg_rtx (wmode), wmode);
create_input_operand (&eops[1], op0, mode);
create_input_operand (&eops[2], op1, mode);
expand_insn (optab_handler (tab2, mode), 3, eops);
m2 = gen_lowpart (mode, eops[0].value);
v = rtvec_alloc (nunits);
if (method == 2)
{
for (i = 0; i < nunits; ++i)
RTVEC_ELT (v, i) = GEN_INT (!BYTES_BIG_ENDIAN + (i & ~1)
+ ((i & 1) ? nunits : 0));
}
else
{
for (i = 0; i < nunits; ++i)
RTVEC_ELT (v, i) = GEN_INT (2 * i + (BYTES_BIG_ENDIAN ? 0 : 1));
}
perm = gen_rtx_CONST_VECTOR (mode, v);
return expand_vec_perm (mode, m1, m2, perm, target);
}
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
/* Return true if target supports vector masked load/store for mode. */
bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_vec_mask_load_store_p (machine_mode mode, bool is_load)
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
{
optab op = is_load ? maskload_optab : maskstore_optab;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode vmode;
tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. * tree-vectorizer.h (struct _loop_vec_info): Add scalar_loop field. (LOOP_VINFO_SCALAR_LOOP): Define. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. * config/i386/sse.md (maskload<mode>, maskstore<mode>): New expanders. * tree-data-ref.c (get_references_in_stmt): Handle MASK_LOAD and MASK_STORE. * internal-fn.def (LOOP_VECTORIZED, MASK_LOAD, MASK_STORE): New internal fns. * tree-if-conv.c: Include expr.h, optabs.h, tree-ssa-loop-ivopts.h and tree-ssa-address.h. (release_bb_predicate): New function. (free_bb_predicate): Use it. (reset_bb_predicate): Likewise. Don't unallocate bb->aux just to immediately allocate it again. (add_to_predicate_list): Add loop argument. If basic blocks that dominate loop->latch don't insert any predicate. (add_to_dst_predicate_list): Adjust caller. (if_convertible_phi_p): Add any_mask_load_store argument, if true, handle it like flag_tree_loop_if_convert_stores. (insert_gimplified_predicates): Likewise. (ifcvt_can_use_mask_load_store): New function. (if_convertible_gimple_assign_stmt_p): Add any_mask_load_store argument, check if some conditional loads or stores can't be converted into MASK_LOAD or MASK_STORE. (if_convertible_stmt_p): Add any_mask_load_store argument, pass it down to if_convertible_gimple_assign_stmt_p. (predicate_bbs): Don't return bool, only check if the last stmt of a basic block is GIMPLE_COND and handle that. Adjust add_to_predicate_list caller. (if_convertible_loop_p_1): Only call predicate_bbs if flag_tree_loop_if_convert_stores and free_bb_predicate in that case afterwards, check gimple_code of stmts here. Replace is_predicated check with dominance check. Add any_mask_load_store argument, pass it down to if_convertible_stmt_p and if_convertible_phi_p, call if_convertible_phi_p only after all if_convertible_stmt_p calls. (if_convertible_loop_p): Add any_mask_load_store argument, pass it down to if_convertible_loop_p_1. (predicate_mem_writes): Emit MASK_LOAD and/or MASK_STORE calls. (combine_blocks): Add any_mask_load_store argument, pass it down to insert_gimplified_predicates and call predicate_mem_writes if it is set. Call predicate_bbs. (version_loop_for_if_conversion): New function. (tree_if_conversion): Adjust if_convertible_loop_p and combine_blocks calls. Return todo flags instead of bool, call version_loop_for_if_conversion if if-conversion should be just for the vectorized loops and nothing else. (main_tree_if_conversion): Adjust caller. Don't call tree_if_conversion for dont_vectorize loops if if-conversion isn't explicitly enabled. * tree-vect-data-refs.c (vect_check_gather): Handle MASK_LOAD/MASK_STORE. (vect_analyze_data_refs, vect_supportable_dr_alignment): Likewise. * gimple.h (gimple_expr_type): Handle MASK_STORE. * internal-fn.c (expand_LOOP_VECTORIZED, expand_MASK_LOAD, expand_MASK_STORE): New functions. * tree-vectorizer.c: Include tree-cfg.h and gimple-fold.h. (vect_loop_vectorized_call, fold_loop_vectorized_call): New functions. (vectorize_loops): Don't try to vectorize loops with loop->dont_vectorize set. Set LOOP_VINFO_SCALAR_LOOP for if-converted loops, fold LOOP_VECTORIZED internal call depending on if loop has been vectorized or not. * tree-vect-loop-manip.c (slpeel_duplicate_current_defs_from_edges): New function. (slpeel_tree_duplicate_loop_to_edge_cfg): Add scalar_loop argument. If non-NULL, copy basic blocks from scalar_loop instead of loop, but still to loop's entry or exit edge. (slpeel_tree_peel_loop_to_edge): Add scalar_loop argument, pass it down to slpeel_tree_duplicate_loop_to_edge_cfg. (vect_do_peeling_for_loop_bound, vect_do_peeling_for_loop_alignment): Adjust callers. (vect_loop_versioning): If LOOP_VINFO_SCALAR_LOOP, perform loop versioning from that loop instead of LOOP_VINFO_LOOP, move it to the right place in the CFG afterwards. * tree-vect-loop.c (vect_determine_vectorization_factor): Handle MASK_STORE. * cfgloop.h (struct loop): Add dont_vectorize field. * tree-loop-distribution.c (copy_loop_before): Adjust slpeel_tree_duplicate_loop_to_edge_cfg caller. * optabs.def (maskload_optab, maskstore_optab): New optabs. * passes.def: Add a note that pass_vectorize must immediately follow pass_if_conversion. * tree-predcom.c (split_data_refs_to_components): Give up if DR_STMT is a call. * tree-vect-stmts.c (vect_mark_relevant): Don't crash if lhs is NULL. (exist_non_indexing_operands_for_use_p): Handle MASK_LOAD and MASK_STORE. (vectorizable_mask_load_store): New function. (vectorizable_call): Call it for MASK_LOAD or MASK_STORE. (vect_transform_stmt): Handle MASK_STORE. * tree-ssa-phiopt.c (cond_if_else_store_replacement): Ignore DR_STMT where lhs is NULL. * optabs.h (can_vec_perm_p): Fix up comment typo. (can_vec_mask_load_store_p): New prototype. * optabs.c (can_vec_mask_load_store_p): New function. * gcc.dg/vect/vect-cond-11.c: New test. * gcc.target/i386/vect-cond-1.c: New test. * gcc.target/i386/avx2-gather-5.c: New test. * gcc.target/i386/avx2-gather-6.c: New test. * gcc.dg/vect/vect-mask-loadstore-1.c: New test. * gcc.dg/vect/vect-mask-load-1.c: New test. From-SVN: r205856
2013-12-10 12:46:01 +01:00
unsigned int vector_sizes;
/* If mode is vector mode, check it directly. */
if (VECTOR_MODE_P (mode))
return optab_handler (op, mode) != CODE_FOR_nothing;
/* Otherwise, return true if there is some vector mode with
the mask load/store supported. */
/* See if there is any chance the mask load or store might be
vectorized. If not, punt. */
vmode = targetm.vectorize.preferred_simd_mode (mode);
if (!VECTOR_MODE_P (vmode))
return false;
if (optab_handler (op, vmode) != CODE_FOR_nothing)
return true;
vector_sizes = targetm.vectorize.autovectorize_vector_sizes ();
while (vector_sizes != 0)
{
unsigned int cur = 1 << floor_log2 (vector_sizes);
vector_sizes &= ~cur;
if (cur <= GET_MODE_SIZE (mode))
continue;
vmode = mode_for_vector (mode, cur / GET_MODE_SIZE (mode));
if (VECTOR_MODE_P (vmode)
&& optab_handler (op, vmode) != CODE_FOR_nothing)
return true;
}
return false;
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Return true if there is a compare_and_swap pattern. */
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_compare_and_swap_p (machine_mode mode, bool allow_libcall)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
enum insn_code icode;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Check for __atomic_compare_and_swap. */
icode = direct_optab_handler (atomic_compare_and_swap_optab, mode);
if (icode != CODE_FOR_nothing)
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
return true;
/* Check for __sync_compare_and_swap. */
icode = optab_handler (sync_compare_and_swap_optab, mode);
if (icode != CODE_FOR_nothing)
return true;
if (allow_libcall && optab_libfunc (sync_compare_and_swap_optab, mode))
return true;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* No inline compare and swap. */
return false;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
/* Return true if an atomic exchange can be performed. */
bool
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
can_atomic_exchange_p (machine_mode mode, bool allow_libcall)
{
enum insn_code icode;
/* Check for __atomic_exchange. */
icode = direct_optab_handler (atomic_exchange_optab, mode);
if (icode != CODE_FOR_nothing)
return true;
/* Don't check __sync_test_and_set, as on some platforms that
has reduced functionality. Targets that really do support
a proper exchange should simply be updated to the __atomics. */
return can_compare_and_swap_p (mode, allow_libcall);
}
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
/* Helper function to find the MODE_CC set in a sync_compare_and_swap
pattern. */
static void
find_cc_set (rtx x, const_rtx pat, void *data)
{
if (REG_P (x) && GET_MODE_CLASS (GET_MODE (x)) == MODE_CC
&& GET_CODE (pat) == SET)
{
rtx *p_cc_reg = (rtx *) data;
gcc_assert (!*p_cc_reg);
*p_cc_reg = x;
}
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* This is a helper function for the other atomic operations. This function
emits a loop that contains SEQ that iterates until a compare-and-swap
operation at the end succeeds. MEM is the memory to be modified. SEQ is
a set of instructions that takes a value from OLD_REG as an input and
produces a value in NEW_REG as an output. Before SEQ, OLD_REG will be
set to the current contents of MEM. After SEQ, a compare-and-swap will
attempt to update MEM with NEW_REG. The function returns true when the
loop was generated successfully. */
static bool
expand_compare_and_swap_loop (rtx mem, rtx old_reg, rtx new_reg, rtx seq)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_code_label *label;
rtx cmp_reg, success, oldval;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* The loop we want to generate looks like
cmp_reg = mem;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
label:
old_reg = cmp_reg;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
seq;
(success, cmp_reg) = compare-and-swap(mem, old_reg, new_reg)
if (success)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
goto label;
Note that we only do the plain load from memory once. Subsequent
iterations use the value loaded by the compare-and-swap pattern. */
label = gen_label_rtx ();
cmp_reg = gen_reg_rtx (mode);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
emit_move_insn (cmp_reg, mem);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
emit_label (label);
emit_move_insn (old_reg, cmp_reg);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
if (seq)
emit_insn (seq);
success = NULL_RTX;
oldval = cmp_reg;
if (!expand_atomic_compare_and_swap (&success, &oldval, mem, old_reg,
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
new_reg, false, MEMMODEL_SYNC_SEQ_CST,
MEMMODEL_RELAXED))
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
return false;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
if (oldval != cmp_reg)
emit_move_insn (cmp_reg, oldval);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
/* Mark this jump predicted not taken. */
emit_cmp_and_jump_insns (success, const0_rtx, EQ, const0_rtx,
[multiple changes] 2012-10-15 Easwaran Raman <eraman@google.com> * optabs.c (emit_cmp_and_jump_insn_1): Add a new parameter to specificy the probability of taking the jump. (emit_cmp_and_jump_insns): Likewise. (expand_compare_and_swap_loop): Make the jump predicted not taken. * dojump.c (do_compare_rtx_and_jump): Remove the code attaching REG_BR_PROB note and pass probability to emit_cmp_and_jump_insns. * cfgbuild.c (compute_outgoing_frequencies): Do not guess outgoing probabilities for branches with more than two successors. * expr.c (emit_block_move_via_loop): Predict the loop backedge loop to be highly taken. (try_casesi): Pass the probability of jumping to the default label. (try_tablejump): Likewise. (do_tablejump): Likewise. * expr.h (try_tablejump): Add a new parameter. (try_casesi): Likewise. (emit_cmp_and_jump_insns): Add probability as default parameter with a default value of -1. * except.c (sjlj_emit_function_enter): Pass probability to emit_cmp_and_jump_insns. * stmt.c (case_node): Add new fields PROB and SUBTREE_PROB. (do_jump_if_equal): Pass probability for REG_BR_PROB note. (add_case_node): Pass estimated probability of jumping to the case label. (emit_case_decision_tree): Pass default_prob to emit_case_nodes. (get_outgoing_edge_probs): New function. (conditional_probability): Likewise. (reset_out_edges_aux): Likewise. (compute_cases_per_edge): Likewise. (emit_case_dispatch_table): Update probabilities of edges coming out of the switch statement. (expand_case): Compute and propagate default edge probability to emit_case_dispatch_table. (expand_sjlj_dispatch_table): Update calls to add_case_node and emit_case_dispatch_table. (balance_case_nodes): Update subtree_prob values. (emit_case_nodes): Compute edge probabilities and add pass them to emit_cmp_and_jump_insns. testsuite/ChangeLog: 2012-10-15 Easwaran Raman <eraman@google.com> * gcc.dg/tree-prof/switch-case-1.c: New test case. * gcc.dg/tree-prof/switch-case-2.c: New test case. From-SVN: r192488
2012-10-16 07:28:08 +02:00
GET_MODE (success), 1, label, 0);
return true;
}
/* This function tries to emit an atomic_exchange intruction. VAL is written
to *MEM using memory model MODEL. The previous contents of *MEM are returned,
using TARGET if possible. */
static rtx
maybe_emit_atomic_exchange (rtx target, rtx mem, rtx val, enum memmodel model)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
enum insn_code icode;
/* If the target supports the exchange directly, great. */
icode = direct_optab_handler (atomic_exchange_optab, mode);
if (icode != CODE_FOR_nothing)
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
{
struct expand_operand ops[4];
create_output_operand (&ops[0], target, mode);
create_fixed_operand (&ops[1], mem);
create_input_operand (&ops[2], val, mode);
create_integer_operand (&ops[3], model);
if (maybe_expand_insn (icode, 4, ops))
return ops[0].value;
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
}
return NULL_RTX;
}
/* This function tries to implement an atomic exchange operation using
__sync_lock_test_and_set. VAL is written to *MEM using memory model MODEL.
The previous contents of *MEM are returned, using TARGET if possible.
Since this instructionn is an acquire barrier only, stronger memory
models may require additional barriers to be emitted. */
static rtx
maybe_emit_sync_lock_test_and_set (rtx target, rtx mem, rtx val,
enum memmodel model)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
enum insn_code icode;
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last_insn = get_last_insn ();
icode = optab_handler (sync_lock_test_and_set_optab, mode);
/* Legacy sync_lock_test_and_set is an acquire barrier. If the pattern
exists, and the memory model is stronger than acquire, add a release
barrier before the instruction. */
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
if (is_mm_seq_cst (model) || is_mm_release (model) || is_mm_acq_rel (model))
expand_mem_thread_fence (model);
if (icode != CODE_FOR_nothing)
i386.md (cmpcc): New. 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (cmpcc): New. * config/i386/sync.md (sync_compare_and_swap*): Set FLAGS_REG. (sync_compare_and_swap_cc*): Delete. * config/s390/s390.c (s390_compare_emitted): Remove. (s390_emit_compare): Handle MODE_CC s390_compare_op0 like s390_compare_emitted used to be handled. Assert that modes match. (s390_emit_compare_and_swap): Use s390_emit_compare, do not refer to sync_compare_and_swap_ccsi. * config/s390/s390.h (s390_compare_emitted): Remove. * config/s390/s390.md (seq): Look for MODE_CC s390_compare_op0 instead of s390_compare_emitted. (stack_protect_test, sync_compare_and_swap_cc): Set s390_compare_op0 instead of s390_compare_emitted. * config/s390/s390.md (cmpcc): New. (sync_compare_and_swapqi, sync_compare_and_swaphi): Clobber CC_REGNUM, do not pretend it's set. (sync_compare_and_swap_cc*): Delete. * config/s390/predicates.md (cc_reg_operand): New. * expr.c (sync_compare_and_swap_cc): Delete. * optabs.h (sync_compare_and_swap_cc): Delete. * optabs.c (prepare_cmp_insn): Ignore which specific CCmode is being used with can_compare_p. (emit_cmp_and_jump_insn_1): Likewise when looking in the optab. (find_cc_set): New. (expand_bool_compare_and_swap): Do not use sync_compare_and_swap_cc, look for a MODE_CC set instead. Use emit_store_flag. (expand_compare_and_swap_loop): Likewise, with some additional complication to avoid a force_reg when useless. Use emit_cmp_and_jump_insns. * genopinit.c (optabs): Delete sync_compare_and_swap_cc. * doc/md.texi (sync_compare_and_swap_cc): Merge with sync_compare_and_swap documentation. java: 2009-04-09 Paolo Bonzini <bonzini@gnu.org> * builtins.c (compareAndSwapLong_builtin, compareAndSwapInt_builtin, compareAndSwapObject_builtin, VMSupportsCS8_builtin): Do not look at sync_compare_and_swap_cc. From-SVN: r145825
2009-04-09 12:57:03 +02:00
{
struct expand_operand ops[3];
create_output_operand (&ops[0], target, mode);
create_fixed_operand (&ops[1], mem);
create_input_operand (&ops[2], val, mode);
if (maybe_expand_insn (icode, 3, ops))
return ops[0].value;
}
/* If an external test-and-set libcall is provided, use that instead of
any external compare-and-swap that we might get from the compare-and-
swap-loop expansion later. */
if (!can_compare_and_swap_p (mode, false))
{
rtx libfunc = optab_libfunc (sync_lock_test_and_set_optab, mode);
if (libfunc != NULL)
{
rtx addr;
addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
return emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
mode, 2, addr, ptr_mode,
val, mode);
}
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* If the test_and_set can't be emitted, eliminate any barrier that might
have been emitted. */
delete_insns_since (last_insn);
return NULL_RTX;
}
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
/* This function tries to implement an atomic exchange operation using a
compare_and_swap loop. VAL is written to *MEM. The previous contents of
*MEM are returned, using TARGET if possible. No memory model is required
since a compare_and_swap loop is seq-cst. */
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
static rtx
maybe_emit_compare_and_swap_exchange_loop (rtx target, rtx mem, rtx val)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
if (can_compare_and_swap_p (mode, true))
{
if (!target || !register_operand (target, mode))
target = gen_reg_rtx (mode);
if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX))
return target;
}
return NULL_RTX;
}
/* This function tries to implement an atomic test-and-set operation
using the atomic_test_and_set instruction pattern. A boolean value
is returned from the operation, using TARGET if possible. */
#ifndef HAVE_atomic_test_and_set
#define HAVE_atomic_test_and_set 0
#define CODE_FOR_atomic_test_and_set CODE_FOR_nothing
#endif
static rtx
maybe_emit_atomic_test_and_set (rtx target, rtx mem, enum memmodel model)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode pat_bool_mode;
struct expand_operand ops[3];
if (!HAVE_atomic_test_and_set)
return NULL_RTX;
/* While we always get QImode from __atomic_test_and_set, we get
other memory modes from __sync_lock_test_and_set. Note that we
use no endian adjustment here. This matches the 4.6 behavior
in the Sparc backend. */
gcc_checking_assert
(insn_data[CODE_FOR_atomic_test_and_set].operand[1].mode == QImode);
if (GET_MODE (mem) != QImode)
mem = adjust_address_nv (mem, QImode, 0);
pat_bool_mode = insn_data[CODE_FOR_atomic_test_and_set].operand[0].mode;
create_output_operand (&ops[0], target, pat_bool_mode);
create_fixed_operand (&ops[1], mem);
create_integer_operand (&ops[2], model);
if (maybe_expand_insn (CODE_FOR_atomic_test_and_set, 3, ops))
return ops[0].value;
return NULL_RTX;
}
/* This function expands the legacy _sync_lock test_and_set operation which is
generally an atomic exchange. Some limited targets only allow the
constant 1 to be stored. This is an ACQUIRE operation.
TARGET is an optional place to stick the return value.
MEM is where VAL is stored. */
rtx
expand_sync_lock_test_and_set (rtx target, rtx mem, rtx val)
{
rtx ret;
/* Try an atomic_exchange first. */
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
ret = maybe_emit_atomic_exchange (target, mem, val, MEMMODEL_SYNC_ACQUIRE);
if (ret)
return ret;
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
ret = maybe_emit_sync_lock_test_and_set (target, mem, val,
MEMMODEL_SYNC_ACQUIRE);
if (ret)
return ret;
ret = maybe_emit_compare_and_swap_exchange_loop (target, mem, val);
if (ret)
return ret;
/* If there are no other options, try atomic_test_and_set if the value
being stored is 1. */
if (val == const1_rtx)
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
ret = maybe_emit_atomic_test_and_set (target, mem, MEMMODEL_SYNC_ACQUIRE);
return ret;
}
/* This function expands the atomic test_and_set operation:
atomically store a boolean TRUE into MEM and return the previous value.
MEMMODEL is the memory model variant to use.
TARGET is an optional place to stick the return value. */
rtx
expand_atomic_test_and_set (rtx target, rtx mem, enum memmodel model)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
rtx ret, trueval, subtarget;
ret = maybe_emit_atomic_test_and_set (target, mem, model);
if (ret)
return ret;
/* Be binary compatible with non-default settings of trueval, and different
cpu revisions. E.g. one revision may have atomic-test-and-set, but
another only has atomic-exchange. */
if (targetm.atomic_test_and_set_trueval == 1)
{
trueval = const1_rtx;
subtarget = target ? target : gen_reg_rtx (mode);
}
else
{
trueval = gen_int_mode (targetm.atomic_test_and_set_trueval, mode);
subtarget = gen_reg_rtx (mode);
}
/* Try the atomic-exchange optab... */
ret = maybe_emit_atomic_exchange (subtarget, mem, trueval, model);
/* ... then an atomic-compare-and-swap loop ... */
if (!ret)
ret = maybe_emit_compare_and_swap_exchange_loop (subtarget, mem, trueval);
/* ... before trying the vaguely defined legacy lock_test_and_set. */
if (!ret)
ret = maybe_emit_sync_lock_test_and_set (subtarget, mem, trueval, model);
/* Recall that the legacy lock_test_and_set optab was allowed to do magic
things with the value 1. Thus we try again without trueval. */
if (!ret && targetm.atomic_test_and_set_trueval != 1)
ret = maybe_emit_sync_lock_test_and_set (subtarget, mem, const1_rtx, model);
/* Failing all else, assume a single threaded environment and simply
perform the operation. */
if (!ret)
{
/* If the result is ignored skip the move to target. */
if (subtarget != const0_rtx)
emit_move_insn (subtarget, mem);
emit_move_insn (mem, trueval);
ret = subtarget;
}
/* Recall that have to return a boolean value; rectify if trueval
is not exactly one. */
if (targetm.atomic_test_and_set_trueval != 1)
ret = emit_store_flag_force (target, NE, ret, const0_rtx, mode, 0, 1);
return ret;
}
/* This function expands the atomic exchange operation:
atomically store VAL in MEM and return the previous value in MEM.
MEMMODEL is the memory model variant to use.
TARGET is an optional place to stick the return value. */
rtx
expand_atomic_exchange (rtx target, rtx mem, rtx val, enum memmodel model)
{
rtx ret;
ret = maybe_emit_atomic_exchange (target, mem, val, model);
/* Next try a compare-and-swap loop for the exchange. */
if (!ret)
ret = maybe_emit_compare_and_swap_exchange_loop (target, mem, val);
return ret;
}
/* This function expands the atomic compare exchange operation:
*PTARGET_BOOL is an optional place to store the boolean success/failure.
*PTARGET_OVAL is an optional place to store the old value from memory.
Both target parameters may be NULL to indicate that we do not care about
that return value. Both target parameters are updated on success to
the actual location of the corresponding result.
MEMMODEL is the memory model variant to use.
The return value of the function is true for success. */
bool
expand_atomic_compare_and_swap (rtx *ptarget_bool, rtx *ptarget_oval,
rtx mem, rtx expected, rtx desired,
bool is_weak, enum memmodel succ_model,
enum memmodel fail_model)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
struct expand_operand ops[8];
enum insn_code icode;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
rtx target_oval, target_bool = NULL_RTX;
rtx libfunc;
/* Load expected into a register for the compare and swap. */
if (MEM_P (expected))
expected = copy_to_reg (expected);
/* Make sure we always have some place to put the return oldval.
Further, make sure that place is distinct from the input expected,
just in case we need that path down below. */
if (ptarget_oval == NULL
|| (target_oval = *ptarget_oval) == NULL
|| reg_overlap_mentioned_p (expected, target_oval))
target_oval = gen_reg_rtx (mode);
icode = direct_optab_handler (atomic_compare_and_swap_optab, mode);
if (icode != CODE_FOR_nothing)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode bool_mode = insn_data[icode].operand[0].mode;
/* Make sure we always have a place for the bool operand. */
if (ptarget_bool == NULL
|| (target_bool = *ptarget_bool) == NULL
|| GET_MODE (target_bool) != bool_mode)
target_bool = gen_reg_rtx (bool_mode);
/* Emit the compare_and_swap. */
create_output_operand (&ops[0], target_bool, bool_mode);
create_output_operand (&ops[1], target_oval, mode);
create_fixed_operand (&ops[2], mem);
create_input_operand (&ops[3], expected, mode);
create_input_operand (&ops[4], desired, mode);
create_integer_operand (&ops[5], is_weak);
create_integer_operand (&ops[6], succ_model);
create_integer_operand (&ops[7], fail_model);
if (maybe_expand_insn (icode, 8, ops))
{
/* Return success/failure. */
target_bool = ops[0].value;
target_oval = ops[1].value;
goto success;
}
}
/* Otherwise fall back to the original __sync_val_compare_and_swap
which is always seq-cst. */
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
icode = optab_handler (sync_compare_and_swap_optab, mode);
if (icode != CODE_FOR_nothing)
{
rtx cc_reg;
create_output_operand (&ops[0], target_oval, mode);
create_fixed_operand (&ops[1], mem);
create_input_operand (&ops[2], expected, mode);
create_input_operand (&ops[3], desired, mode);
if (!maybe_expand_insn (icode, 4, ops))
return false;
target_oval = ops[0].value;
/* If the caller isn't interested in the boolean return value,
skip the computation of it. */
if (ptarget_bool == NULL)
goto success;
/* Otherwise, work out if the compare-and-swap succeeded. */
cc_reg = NULL_RTX;
if (have_insn_for (COMPARE, CCmode))
note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
if (cc_reg)
{
target_bool = emit_store_flag_force (target_bool, EQ, cc_reg,
const0_rtx, VOIDmode, 0, 1);
goto success;
}
goto success_bool_from_val;
}
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
/* Also check for library support for __sync_val_compare_and_swap. */
libfunc = optab_libfunc (sync_compare_and_swap_optab, mode);
if (libfunc != NULL)
{
rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
target_oval = emit_library_call_value (libfunc, NULL_RTX, LCT_NORMAL,
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
mode, 3, addr, ptr_mode,
expected, mode, desired, mode);
/* Compute the boolean return value only if requested. */
if (ptarget_bool)
goto success_bool_from_val;
else
goto success;
}
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
/* Failure. */
return false;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
success_bool_from_val:
target_bool = emit_store_flag_force (target_bool, EQ, target_oval,
expected, VOIDmode, 1, 1);
success:
/* Make sure that the oval output winds up where the caller asked. */
if (ptarget_oval)
*ptarget_oval = target_oval;
if (ptarget_bool)
*ptarget_bool = target_bool;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
return true;
}
/* Generate asm volatile("" : : : "memory") as the memory barrier. */
static void
expand_asm_memory_barrier (void)
{
rtx asm_op, clob;
asm_op = gen_rtx_ASM_OPERANDS (VOIDmode, empty_string, empty_string, 0,
rtvec_alloc (0), rtvec_alloc (0),
rtvec_alloc (0), UNKNOWN_LOCATION);
MEM_VOLATILE_P (asm_op) = 1;
clob = gen_rtx_SCRATCH (VOIDmode);
clob = gen_rtx_MEM (BLKmode, clob);
clob = gen_rtx_CLOBBER (VOIDmode, clob);
emit_insn (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, asm_op, clob)));
}
/* This routine will either emit the mem_thread_fence pattern or issue a
sync_synchronize to generate a fence for memory model MEMMODEL. */
void
expand_mem_thread_fence (enum memmodel model)
{
if (targetm.have_mem_thread_fence ())
emit_insn (targetm.gen_mem_thread_fence (GEN_INT (model)));
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
else if (!is_mm_relaxed (model))
{
if (targetm.have_memory_barrier ())
emit_insn (targetm.gen_memory_barrier ());
else if (synchronize_libfunc != NULL_RTX)
emit_library_call (synchronize_libfunc, LCT_NORMAL, VOIDmode, 0);
else
expand_asm_memory_barrier ();
}
}
/* This routine will either emit the mem_signal_fence pattern or issue a
sync_synchronize to generate a fence for memory model MEMMODEL. */
void
expand_mem_signal_fence (enum memmodel model)
{
if (targetm.have_mem_signal_fence ())
emit_insn (targetm.gen_mem_signal_fence (GEN_INT (model)));
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
else if (!is_mm_relaxed (model))
{
/* By default targets are coherent between a thread and the signal
handler running on the same thread. Thus this really becomes a
compiler barrier, in that stores must not be sunk past
(or raised above) a given point. */
expand_asm_memory_barrier ();
}
}
/* This function expands the atomic load operation:
return the atomically loaded value in MEM.
MEMMODEL is the memory model variant to use.
TARGET is an option place to stick the return value. */
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
rtx
expand_atomic_load (rtx target, rtx mem, enum memmodel model)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
enum insn_code icode;
/* If the target supports the load directly, great. */
icode = direct_optab_handler (atomic_load_optab, mode);
if (icode != CODE_FOR_nothing)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
struct expand_operand ops[3];
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
create_output_operand (&ops[0], target, mode);
create_fixed_operand (&ops[1], mem);
create_integer_operand (&ops[2], model);
if (maybe_expand_insn (icode, 3, ops))
return ops[0].value;
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* If the size of the object is greater than word size on this target,
then we assume that a load will not be atomic. */
if (GET_MODE_PRECISION (mode) > BITS_PER_WORD)
{
/* Issue val = compare_and_swap (mem, 0, 0).
This may cause the occasional harmless store of 0 when the value is
already 0, but it seems to be OK according to the standards guys. */
if (expand_atomic_compare_and_swap (NULL, &target, mem, const0_rtx,
const0_rtx, false, model, model))
return target;
else
/* Otherwise there is no atomic load, leave the library call. */
return NULL_RTX;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
/* Otherwise assume loads are atomic, and emit the proper barriers. */
if (!target || target == const0_rtx)
target = gen_reg_rtx (mode);
/* For SEQ_CST, emit a barrier before the load. */
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
if (is_mm_seq_cst (model))
expand_mem_thread_fence (model);
emit_move_insn (target, mem);
/* Emit the appropriate barrier after the load. */
expand_mem_thread_fence (model);
return target;
}
/* This function expands the atomic store operation:
Atomically store VAL in MEM.
MEMMODEL is the memory model variant to use.
USE_RELEASE is true if __sync_lock_release can be used as a fall back.
function returns const0_rtx if a pattern was emitted. */
rtx
expand_atomic_store (rtx mem, rtx val, enum memmodel model, bool use_release)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
enum insn_code icode;
struct expand_operand ops[3];
/* If the target supports the store directly, great. */
icode = direct_optab_handler (atomic_store_optab, mode);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
if (icode != CODE_FOR_nothing)
{
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
create_fixed_operand (&ops[0], mem);
create_input_operand (&ops[1], val, mode);
create_integer_operand (&ops[2], model);
if (maybe_expand_insn (icode, 3, ops))
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
return const0_rtx;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
/* If using __sync_lock_release is a viable alternative, try it. */
if (use_release)
{
icode = direct_optab_handler (sync_lock_release_optab, mode);
if (icode != CODE_FOR_nothing)
{
create_fixed_operand (&ops[0], mem);
create_input_operand (&ops[1], const0_rtx, mode);
if (maybe_expand_insn (icode, 2, ops))
{
/* lock_release is only a release barrier. */
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
if (is_mm_seq_cst (model))
expand_mem_thread_fence (model);
return const0_rtx;
}
}
}
/* If the size of the object is greater than word size on this target,
a default store will not be atomic, Try a mem_exchange and throw away
the result. If that doesn't work, don't do anything. */
alloc-pool.c, [...]: Add missing whitespace before "(". gcc/ * alloc-pool.c, asan.c, auto-inc-dec.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, bt-load.c, builtins.c, calls.c, cfgcleanup.c, cfgexpand.c, cfghooks.c, cfgloop.c, cfgloopmanip.c, cfgrtl.c, cgraph.c, cgraph.h, cgraphbuild.c, cgraphclones.c, cgraphunit.c, collect2.c, combine-stack-adj.c, combine.c, compare-elim.c, context.c, context.h, cprop.c, cse.c, cselib.c, dbxout.c, dce.c, defaults.h, df-core.c, df-problems.c, df-scan.c, df.h, diagnostic.c, double-int.c, dse.c, dumpfile.c, dwarf2asm.c, dwarf2cfi.c, dwarf2out.c, emit-rtl.c, errors.c, except.c, expmed.c, expr.c, file-find.c, final.c, fixed-value.c, fold-const.c, function.c, fwprop.c, gcc-ar.c, gcc.c, gcov-io.c, gcov-io.h, gcov.c, gcse.c, genattr-common.c, genattr.c, genattrtab.c, genautomata.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, gengtype-state.c, gengtype.c, genmodes.c, genopinit.c, genoutput.c, genpeep.c, genpreds.c, genrecog.c, gensupport.c, ggc-common.c, ggc-page.c, gimple-fold.c, gimple-low.c, gimple-pretty-print.c, gimple-ssa-strength-reduction.c, gimple.c, gimple.h, godump.c, graphite-clast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.h, graphite-sese-to-poly.c, graphite.c, haifa-sched.c, hash-table.c, hash-table.h, hwint.c, hwint.h, ifcvt.c, incpath.c, init-regs.c, input.h, intl.c, intl.h, ipa-cp.c, ipa-devirt.c, ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c, ipa-reference.c, ipa-split.c, ipa-utils.c, ipa.c, ira-build.c, ira.c, jump.c, loop-doloop.c, loop-init.c, loop-invariant.c, loop-iv.c, lower-subreg.c, lto-cgraph.c, lto-streamer-in.c, lto-streamer-out.c, lto-wrapper.c, mcf.c, mode-switching.c, modulo-sched.c, omp-low.c, optabs.c, opts.c, pass_manager.h, passes.c, plugin.c, postreload-gcse.c, postreload.c, predict.c, prefix.c, pretty-print.c, print-rtl.c, print-tree.c, profile.c, read-md.c, real.c, real.h, recog.c, ree.c, reg-stack.c, regcprop.c, reginfo.c, regmove.c, regrename.c, regs.h, regstat.c, reload1.c, reorg.c, rtl.c, rtl.h, rtlanal.c, sbitmap.c, sched-rgn.c, sdbout.c, sel-sched-ir.c, sel-sched.c, sparseset.c, stack-ptr-mod.c, statistics.c, stmt.c, stor-layout.c, store-motion.c, streamer-hooks.h, system.h, target-hooks-macros.h, targhooks.c, targhooks.h, toplev.c, tracer.c, trans-mem.c, tree-browser.c, tree-call-cdce.c, tree-cfg.c, tree-cfgcleanup.c, tree-complex.c, tree-data-ref.c, tree-data-ref.h, tree-eh.c, tree-emutls.c, tree-flow.h, tree-if-conv.c, tree-into-ssa.c, tree-iterator.c, tree-loop-distribution.c, tree-mudflap.c, tree-nested.c, tree-nomudflap.c, tree-nrv.c, tree-object-size.c, tree-optimize.c, tree-pass.h, tree-pretty-print.c, tree-profile.c, tree-scalar-evolution.c, tree-sra.c, tree-ssa-ccp.c, tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c, tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c, tree-ssa-ifcombine.c, tree-ssa-live.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-prefetch.c, tree-ssa-loop.c, tree-ssa-math-opts.c, tree-ssa-operands.c, tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c, tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c, tree-ssa-structalias.c, tree-ssa-threadedge.c, tree-ssa-threadupdate.c, tree-ssa-uncprop.c, tree-ssa-uninit.c, tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c, tree-tailcall.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop-manip.c, tree-vect-stmts.c, tree-vectorizer.c, tree-vectorizer.h, tree-vrp.c, tree.c, tree.h, tsan.c, tsystem.h, value-prof.c, var-tracking.c, varasm.c, vec.h, vmsdbgout.c, vtable-verify.c, web.c: Add missing whitespace before "(". From-SVN: r203004
2013-09-28 10:42:34 +02:00
if (GET_MODE_PRECISION (mode) > BITS_PER_WORD)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
rtx target = maybe_emit_atomic_exchange (NULL_RTX, mem, val, model);
if (!target)
target = maybe_emit_compare_and_swap_exchange_loop (NULL_RTX, mem, val);
if (target)
return const0_rtx;
else
return NULL_RTX;
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Otherwise assume stores are atomic, and emit the proper barriers. */
expand_mem_thread_fence (model);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
emit_move_insn (mem, val);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* For SEQ_CST, also emit a barrier after the store. */
re PR target/65697 (__atomic memory barriers not strong enough for __sync builtins) 2015-05-12 Andrew MacLeod <amacleod@redhat.com> PR target/65697 * coretypes.h (MEMMODEL_SYNC, MEMMODEL_BASE_MASK): New macros. (enum memmodel): Add SYNC_{ACQUIRE,RELEASE,SEQ_CST}. * tree.h (memmodel_from_int, memmodel_base, is_mm_relaxed, is_mm_consume,is_mm_acquire, is_mm_release, is_mm_acq_rel, is_mm_seq_cst, is_mm_sync): New accessor functions. * builtins.c (expand_builtin_sync_operation, expand_builtin_compare_and_swap): Use MEMMODEL_SYNC_SEQ_CST. (expand_builtin_sync_lock_release): Use MEMMODEL_SYNC_RELEASE. (get_memmodel, expand_builtin_atomic_compare_exchange, expand_builtin_atomic_load, expand_builtin_atomic_store, expand_builtin_atomic_clear): Use new accessor routines. (expand_builtin_sync_synchronize): Use MEMMODEL_SYNC_SEQ_CST. * optabs.c (expand_compare_and_swap_loop): Use MEMMODEL_SYNC_SEQ_CST. (maybe_emit_sync_lock_test_and_set): Use new accessors and MEMMODEL_SYNC_ACQUIRE. (expand_sync_lock_test_and_set): Use MEMMODEL_SYNC_ACQUIRE. (expand_mem_thread_fence, expand_mem_signal_fence, expand_atomic_load, expand_atomic_store): Use new accessors. * emit-rtl.c (need_atomic_barrier_p): Add additional enum cases. * tsan.c (instrument_builtin_call): Update check for memory model beyond final enum to use MEMMODEL_LAST. * c-family/c-common.c: Use new accessor for memmodel_base. * config/aarch64/aarch64.c (aarch64_expand_compare_and_swap): Use new accessors. * config/aarch64/atomics.md (atomic_load<mode>,atomic_store<mode>, arch64_load_exclusive<mode>, aarch64_store_exclusive<mode>, mem_thread_fence, *dmb): Likewise. * config/alpha/alpha.c (alpha_split_compare_and_swap, alpha_split_compare_and_swap_12): Likewise. * config/arm/arm.c (arm_expand_compare_and_swap, arm_split_compare_and_swap, arm_split_atomic_op): Likewise. * config/arm/sync.md (atomic_load<mode>, atomic_store<mode>, atomic_loaddi): Likewise. * config/i386/i386.c (ix86_destroy_cost_data, ix86_memmodel_check): Likewise. * config/i386/sync.md (mem_thread_fence, atomic_store<mode>): Likewise. * config/ia64/ia64.c (ia64_expand_atomic_op): Add new memmodel cases and use new accessors. * config/ia64/sync.md (mem_thread_fence, atomic_load<mode>, atomic_store<mode>, atomic_compare_and_swap<mode>, atomic_exchange<mode>): Use new accessors. * config/mips/mips.c (mips_process_sync_loop): Likewise. * config/pa/pa.md (atomic_loaddi, atomic_storedi): Likewise. * config/rs6000/rs6000.c (rs6000_pre_atomic_barrier, rs6000_post_atomic_barrier): Add new cases. (rs6000_expand_atomic_compare_and_swap): Use new accessors. * config/rs6000/sync.md (mem_thread_fence): Add new cases. (atomic_load<mode>): Add new cases and use new accessors. (store_quadpti): Add new cases. * config/s390/s390.md (mem_thread_fence, atomic_store<mode>): Use new accessors. * config/sparc/sparc.c (sparc_emit_membar_for_model): Use new accessors. * doc/extend.texi: Update docs to indicate 16 bits are used for memory model, not 8. From-SVN: r223096
2015-05-12 22:01:47 +02:00
if (is_mm_seq_cst (model))
expand_mem_thread_fence (model);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
return const0_rtx;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
/* Structure containing the pointers and values required to process the
various forms of the atomic_fetch_op and atomic_op_fetch builtins. */
struct atomic_op_functions
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
direct_optab mem_fetch_before;
direct_optab mem_fetch_after;
direct_optab mem_no_result;
optab fetch_before;
optab fetch_after;
direct_optab no_result;
enum rtx_code reverse_code;
};
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Fill in structure pointed to by OP with the various optab entries for an
operation of type CODE. */
static void
get_atomic_op_for_code (struct atomic_op_functions *op, enum rtx_code code)
{
gcc_assert (op!= NULL);
/* If SWITCHABLE_TARGET is defined, then subtargets can be switched
in the source code during compilation, and the optab entries are not
computable until runtime. Fill in the values at runtime. */
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
switch (code)
{
case PLUS:
op->mem_fetch_before = atomic_fetch_add_optab;
op->mem_fetch_after = atomic_add_fetch_optab;
op->mem_no_result = atomic_add_optab;
op->fetch_before = sync_old_add_optab;
op->fetch_after = sync_new_add_optab;
op->no_result = sync_add_optab;
op->reverse_code = MINUS;
break;
case MINUS:
op->mem_fetch_before = atomic_fetch_sub_optab;
op->mem_fetch_after = atomic_sub_fetch_optab;
op->mem_no_result = atomic_sub_optab;
op->fetch_before = sync_old_sub_optab;
op->fetch_after = sync_new_sub_optab;
op->no_result = sync_sub_optab;
op->reverse_code = PLUS;
break;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
case XOR:
op->mem_fetch_before = atomic_fetch_xor_optab;
op->mem_fetch_after = atomic_xor_fetch_optab;
op->mem_no_result = atomic_xor_optab;
op->fetch_before = sync_old_xor_optab;
op->fetch_after = sync_new_xor_optab;
op->no_result = sync_xor_optab;
op->reverse_code = XOR;
break;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
case AND:
op->mem_fetch_before = atomic_fetch_and_optab;
op->mem_fetch_after = atomic_and_fetch_optab;
op->mem_no_result = atomic_and_optab;
op->fetch_before = sync_old_and_optab;
op->fetch_after = sync_new_and_optab;
op->no_result = sync_and_optab;
op->reverse_code = UNKNOWN;
break;
case IOR:
op->mem_fetch_before = atomic_fetch_or_optab;
op->mem_fetch_after = atomic_or_fetch_optab;
op->mem_no_result = atomic_or_optab;
op->fetch_before = sync_old_ior_optab;
op->fetch_after = sync_new_ior_optab;
op->no_result = sync_ior_optab;
op->reverse_code = UNKNOWN;
break;
case NOT:
op->mem_fetch_before = atomic_fetch_nand_optab;
op->mem_fetch_after = atomic_nand_fetch_optab;
op->mem_no_result = atomic_nand_optab;
op->fetch_before = sync_old_nand_optab;
op->fetch_after = sync_new_nand_optab;
op->no_result = sync_nand_optab;
op->reverse_code = UNKNOWN;
break;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
default:
gcc_unreachable ();
}
}
/* See if there is a more optimal way to implement the operation "*MEM CODE VAL"
using memory order MODEL. If AFTER is true the operation needs to return
the value of *MEM after the operation, otherwise the previous value.
TARGET is an optional place to place the result. The result is unused if
it is const0_rtx.
Return the result if there is a better sequence, otherwise NULL_RTX. */
static rtx
maybe_optimize_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code,
enum memmodel model, bool after)
{
/* If the value is prefetched, or not used, it may be possible to replace
the sequence with a native exchange operation. */
if (!after || target == const0_rtx)
{
/* fetch_and (&x, 0, m) can be replaced with exchange (&x, 0, m). */
if (code == AND && val == const0_rtx)
{
if (target == const0_rtx)
target = gen_reg_rtx (GET_MODE (mem));
return maybe_emit_atomic_exchange (target, mem, val, model);
}
/* fetch_or (&x, -1, m) can be replaced with exchange (&x, -1, m). */
if (code == IOR && val == constm1_rtx)
{
if (target == const0_rtx)
target = gen_reg_rtx (GET_MODE (mem));
return maybe_emit_atomic_exchange (target, mem, val, model);
}
}
return NULL_RTX;
}
/* Try to emit an instruction for a specific operation varaition.
OPTAB contains the OP functions.
TARGET is an optional place to return the result. const0_rtx means unused.
MEM is the memory location to operate on.
VAL is the value to use in the operation.
USE_MEMMODEL is TRUE if the variation with a memory model should be tried.
MODEL is the memory model, if used.
AFTER is true if the returned result is the value after the operation. */
static rtx
maybe_emit_op (const struct atomic_op_functions *optab, rtx target, rtx mem,
rtx val, bool use_memmodel, enum memmodel model, bool after)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
struct expand_operand ops[4];
enum insn_code icode;
int op_counter = 0;
int num_ops;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Check to see if there is a result returned. */
if (target == const0_rtx)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
if (use_memmodel)
{
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
icode = direct_optab_handler (optab->mem_no_result, mode);
create_integer_operand (&ops[2], model);
num_ops = 3;
}
else
{
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
icode = direct_optab_handler (optab->no_result, mode);
num_ops = 2;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
}
/* Otherwise, we need to generate a result. */
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
else
{
if (use_memmodel)
{
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
icode = direct_optab_handler (after ? optab->mem_fetch_after
: optab->mem_fetch_before, mode);
create_integer_operand (&ops[3], model);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
num_ops = 4;
}
else
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
icode = optab_handler (after ? optab->fetch_after
: optab->fetch_before, mode);
num_ops = 3;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
create_output_operand (&ops[op_counter++], target, mode);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
if (icode == CODE_FOR_nothing)
return NULL_RTX;
create_fixed_operand (&ops[op_counter++], mem);
/* VAL may have been promoted to a wider mode. Shrink it if so. */
create_convert_operand_to (&ops[op_counter++], val, mode, true);
if (maybe_expand_insn (icode, num_ops, ops))
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
return (target == const0_rtx ? const0_rtx : ops[0].value);
return NULL_RTX;
}
/* This function expands an atomic fetch_OP or OP_fetch operation:
TARGET is an option place to stick the return value. const0_rtx indicates
the result is unused.
atomically fetch MEM, perform the operation with VAL and return it to MEM.
CODE is the operation being performed (OP)
MEMMODEL is the memory model variant to use.
AFTER is true to return the result of the operation (OP_fetch).
AFTER is false to return the value before the operation (fetch_OP).
This function will *only* generate instructions if there is a direct
optab. No compare and swap loops or libcalls will be generated. */
static rtx
expand_atomic_fetch_op_no_fallback (rtx target, rtx mem, rtx val,
enum rtx_code code, enum memmodel model,
bool after)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
struct atomic_op_functions optab;
rtx result;
bool unused_result = (target == const0_rtx);
get_atomic_op_for_code (&optab, code);
/* Check to see if there are any better instructions. */
result = maybe_optimize_fetch_op (target, mem, val, code, model, after);
if (result)
return result;
/* Check for the case where the result isn't used and try those patterns. */
if (unused_result)
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
/* Try the memory model variant first. */
result = maybe_emit_op (&optab, target, mem, val, true, model, true);
if (result)
return result;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Next try the old style withuot a memory model. */
result = maybe_emit_op (&optab, target, mem, val, false, model, true);
if (result)
return result;
/* There is no no-result pattern, so try patterns with a result. */
target = NULL_RTX;
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* Try the __atomic version. */
result = maybe_emit_op (&optab, target, mem, val, true, model, after);
if (result)
return result;
/* Try the older __sync version. */
result = maybe_emit_op (&optab, target, mem, val, false, model, after);
if (result)
return result;
/* If the fetch value can be calculated from the other variation of fetch,
try that operation. */
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
if (after || unused_result || optab.reverse_code != UNKNOWN)
{
/* Try the __atomic version, then the older __sync version. */
result = maybe_emit_op (&optab, target, mem, val, true, model, !after);
if (!result)
result = maybe_emit_op (&optab, target, mem, val, false, model, !after);
if (result)
{
/* If the result isn't used, no need to do compensation code. */
if (unused_result)
return result;
/* Issue compensation code. Fetch_after == fetch_before OP val.
Fetch_before == after REVERSE_OP val. */
if (!after)
code = optab.reverse_code;
if (code == NOT)
{
result = expand_simple_binop (mode, AND, result, val, NULL_RTX,
true, OPTAB_LIB_WIDEN);
result = expand_simple_unop (mode, NOT, result, target, true);
}
else
result = expand_simple_binop (mode, code, result, val, target,
true, OPTAB_LIB_WIDEN);
return result;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
}
/* No direct opcode can be generated. */
return NULL_RTX;
}
/* This function expands an atomic fetch_OP or OP_fetch operation:
TARGET is an option place to stick the return value. const0_rtx indicates
the result is unused.
atomically fetch MEM, perform the operation with VAL and return it to MEM.
CODE is the operation being performed (OP)
MEMMODEL is the memory model variant to use.
AFTER is true to return the result of the operation (OP_fetch).
AFTER is false to return the value before the operation (fetch_OP). */
rtx
expand_atomic_fetch_op (rtx target, rtx mem, rtx val, enum rtx_code code,
enum memmodel model, bool after)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = GET_MODE (mem);
rtx result;
bool unused_result = (target == const0_rtx);
result = expand_atomic_fetch_op_no_fallback (target, mem, val, code, model,
after);
if (result)
return result;
/* Add/sub can be implemented by doing the reverse operation with -(val). */
if (code == PLUS || code == MINUS)
{
rtx tmp;
enum rtx_code reverse = (code == PLUS ? MINUS : PLUS);
start_sequence ();
tmp = expand_simple_unop (mode, NEG, val, NULL_RTX, true);
result = expand_atomic_fetch_op_no_fallback (target, mem, tmp, reverse,
model, after);
if (result)
{
/* PLUS worked so emit the insns and return. */
tmp = get_insns ();
end_sequence ();
emit_insn (tmp);
return result;
}
/* PLUS did not work, so throw away the negation code and continue. */
end_sequence ();
}
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
/* Try the __sync libcalls only if we can't do compare-and-swap inline. */
if (!can_compare_and_swap_p (mode, false))
{
rtx libfunc;
bool fixup = false;
enum rtx_code orig_code = code;
struct atomic_op_functions optab;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
get_atomic_op_for_code (&optab, code);
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
libfunc = optab_libfunc (after ? optab.fetch_after
: optab.fetch_before, mode);
if (libfunc == NULL
&& (after || unused_result || optab.reverse_code != UNKNOWN))
{
fixup = true;
if (!after)
code = optab.reverse_code;
libfunc = optab_libfunc (after ? optab.fetch_before
: optab.fetch_after, mode);
}
if (libfunc != NULL)
{
rtx addr = convert_memory_address (ptr_mode, XEXP (mem, 0));
result = emit_library_call_value (libfunc, NULL, LCT_NORMAL, mode,
2, addr, ptr_mode, val, mode);
if (!unused_result && fixup)
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
result = expand_simple_binop (mode, code, result, val, target,
true, OPTAB_LIB_WIDEN);
return result;
}
/* We need the original code for any further attempts. */
code = orig_code;
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
}
/* If nothing else has succeeded, default to a compare and swap loop. */
Allow libcalls to be installed for legacy __sync optabs. This allows a target which implements the __sync interfaces in libgcc to continue to use them transparently with the new __atomic builtins. It is assumed that these libgcc routines DO NOT use spinlocks. This is true of all extant libgcc instances. * optabs.h (OTI_sync_compare_and_swap, OTI_sync_lock_test_and_set, OTI_sync_old_add, OTI_sync_old_sub, OTI_sync_old_ior, OTI_sync_old_and, OTI_sync_old_xor, OTI_sync_old_nand, OTI_sync_new_add, OTI_sync_new_sub, OTI_sync_new_ior, OTI_sync_new_and, OTI_sync_new_xor, OTI_sync_new_nand): Move and rename from the direct_optab_index enum. (sync_compare_and_swap_optab, sync_lock_test_and_set_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab): Read from the optab_table, not the direct_optab_table. (init_sync_libfuncs): Declare. (can_compare_and_swap_p): Update parameters. * optabs.c (init_sync_libfuncs_1, init_sync_libfuncs): New. (can_compare_and_swap_p): Add allow_libcall parameter; if true, test for the legacy compare-and-swap libcall. (expand_atomic_exchange): Use the legacy test-and-set libcall. (expand_atomic_compare_and_swap): Use the legacy CAS libcall. (struct atomic_op_functions): Update for optab type changes. (maybe_emit_op): Likewise. (expand_atomic_fetch_op): Use the legacy fetch-op libcalls. * builtins.c (fold_builtin_atomic_always_lock_free): Update call to can_compare_and_swap_p. * omp-low.c (expand_omp_atomic_fetch_op): Likewise. (expand_omp_atomic_pipeline): Likewise. * genopinit.c (optabs): Make sync_old_*_optab, sync_new_*_optab, sync_compare_and_swap_optab, sync_lock_test_and_set_optab regular optabs. From-SVN: r181134
2011-11-08 00:11:55 +01:00
if (can_compare_and_swap_p (mode, true))
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *insn;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
rtx t0 = gen_reg_rtx (mode), t1;
start_sequence ();
/* If the result is used, get a register for it. */
if (!unused_result)
{
if (!target || !register_operand (target, mode))
target = gen_reg_rtx (mode);
/* If fetch_before, copy the value now. */
if (!after)
emit_move_insn (target, t0);
}
else
target = const0_rtx;
t1 = t0;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
if (code == NOT)
{
re PR middle-end/37908 (atomic NAND op generate wrong code; __sync_nand_and_fetch, __sync_fetch_and_nand) PR middle-end/37908 * optabs.c (expand_sync_operation): Properly handle NAND case by calculating ~(t1 & val) instead of (~t1 & val). * builtins.c (expand_builtin_sync_operation): Warn for changed semantics in NAND builtins. * c.opt (Wsync-nand): New warning option. Describe -Wsync-nand. * doc/invoke.texi (Warning options): Add Wsync-nand. * doc/extend.texi (Atomic Builtins) [__sync_fetch_and_nand]: Correct __sync_fetch_and_nand builtin operation in the example. Add a note about changed semantics in GCC 4.4. [__sync_nand_and_fetch]: Correct __sync_nand_and_fetch builtin operation in the example. Add a note about changed semantics in GCC 4.4. testsuite/ChangeLog: PR middle-end/37908 * gcc.dg/pr37908.c: New test. * gcc.dg/ia64-sync-1.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_si, init_di): Change init value for __sync_fetch_and_nand to -1. (test_si, test_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/ia64-sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_noret_si, init_noret_di): Change init value for __sync_fetch_and_nand to -1. (init_noret_si, init_noret_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_qi, init_qi): Change init value for __sync_fetch_and_nand to -1. (init_hi, init_hi): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-3.c: Copy from sync-2.c instead of including the c source file. * gcc.c-torture/compile/sync-1.c: Add dg-message to look for the warning about changed semantics of NAND builtin. * gcc.c-torture/compile/sync-2.c: Ditto. * gcc.c-torture/compile/sync-3.c: Ditto. From-SVN: r141942
2008-11-17 12:19:06 +01:00
t1 = expand_simple_binop (mode, AND, t1, val, NULL_RTX,
true, OPTAB_LIB_WIDEN);
t1 = expand_simple_unop (mode, code, t1, NULL_RTX, true);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
re PR middle-end/37908 (atomic NAND op generate wrong code; __sync_nand_and_fetch, __sync_fetch_and_nand) PR middle-end/37908 * optabs.c (expand_sync_operation): Properly handle NAND case by calculating ~(t1 & val) instead of (~t1 & val). * builtins.c (expand_builtin_sync_operation): Warn for changed semantics in NAND builtins. * c.opt (Wsync-nand): New warning option. Describe -Wsync-nand. * doc/invoke.texi (Warning options): Add Wsync-nand. * doc/extend.texi (Atomic Builtins) [__sync_fetch_and_nand]: Correct __sync_fetch_and_nand builtin operation in the example. Add a note about changed semantics in GCC 4.4. [__sync_nand_and_fetch]: Correct __sync_nand_and_fetch builtin operation in the example. Add a note about changed semantics in GCC 4.4. testsuite/ChangeLog: PR middle-end/37908 * gcc.dg/pr37908.c: New test. * gcc.dg/ia64-sync-1.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_si, init_di): Change init value for __sync_fetch_and_nand to -1. (test_si, test_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/ia64-sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_noret_si, init_noret_di): Change init value for __sync_fetch_and_nand to -1. (init_noret_si, init_noret_di): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-2.c: Correct __sync_fetch_and_nand and __sync_nand_and_fetch results. Add dg-message to look for the warning about changed semantics of NAND builtin. (init_qi, init_qi): Change init value for __sync_fetch_and_nand to -1. (init_hi, init_hi): Change expected result of __sync_nand_and_fetch to ~7. * gcc.dg/sync-3.c: Copy from sync-2.c instead of including the c source file. * gcc.c-torture/compile/sync-1.c: Add dg-message to look for the warning about changed semantics of NAND builtin. * gcc.c-torture/compile/sync-2.c: Ditto. * gcc.c-torture/compile/sync-3.c: Ditto. From-SVN: r141942
2008-11-17 12:19:06 +01:00
else
t1 = expand_simple_binop (mode, code, t1, val, NULL_RTX, true,
OPTAB_LIB_WIDEN);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
/* For after, copy the value now. */
if (!unused_result && after)
emit_move_insn (target, t1);
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
insn = get_insns ();
end_sequence ();
if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn))
return target;
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
}
return NULL_RTX;
}
/* Return true if OPERAND is suitable for operand number OPNO of
instruction ICODE. */
bool
insn_operand_matches (enum insn_code icode, unsigned int opno, rtx operand)
{
return (!insn_data[(int) icode].operand[opno].predicate
|| (insn_data[(int) icode].operand[opno].predicate
(operand, insn_data[(int) icode].operand[opno].mode)));
}
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
/* TARGET is a target of a multiword operation that we are going to
implement as a series of word-mode operations. Return true if
TARGET is suitable for this purpose. */
bool
valid_multiword_target_p (rtx target)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
int i;
mode = GET_MODE (target);
for (i = 0; i < GET_MODE_SIZE (mode); i += UNITS_PER_WORD)
if (!validate_subreg (word_mode, mode, target, i))
return false;
return true;
}
/* Like maybe_legitimize_operand, but do not change the code of the
current rtx value. */
static bool
maybe_legitimize_operand_same_code (enum insn_code icode, unsigned int opno,
struct expand_operand *op)
{
/* See if the operand matches in its current form. */
if (insn_operand_matches (icode, opno, op->value))
return true;
/* If the operand is a memory whose address has no side effects,
try forcing the address into a non-virtual pseudo register.
The check for side effects is important because copy_to_mode_reg
cannot handle things like auto-modified addresses. */
if (insn_data[(int) icode].operand[opno].allows_mem && MEM_P (op->value))
{
rtx addr, mem;
mem = op->value;
addr = XEXP (mem, 0);
if (!(REG_P (addr) && REGNO (addr) > LAST_VIRTUAL_REGISTER)
&& !side_effects_p (addr))
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode;
last = get_last_insn ();
mode = get_address_mode (mem);
mem = replace_equiv_address (mem, copy_to_mode_reg (mode, addr));
if (insn_operand_matches (icode, opno, mem))
{
op->value = mem;
return true;
}
delete_insns_since (last);
}
}
return false;
}
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
/* Try to make OP match operand OPNO of instruction ICODE. Return true
on success, storing the new operand value back in OP. */
static bool
maybe_legitimize_operand (enum insn_code icode, unsigned int opno,
struct expand_operand *op)
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode, imode;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
bool old_volatile_ok, result;
mode = op->mode;
switch (op->type)
{
case EXPAND_FIXED:
old_volatile_ok = volatile_ok;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
volatile_ok = true;
result = maybe_legitimize_operand_same_code (icode, opno, op);
volatile_ok = old_volatile_ok;
return result;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
case EXPAND_OUTPUT:
gcc_assert (mode != VOIDmode);
if (op->value
&& op->value != const0_rtx
&& GET_MODE (op->value) == mode
&& maybe_legitimize_operand_same_code (icode, opno, op))
return true;
op->value = gen_reg_rtx (mode);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
break;
case EXPAND_INPUT:
input:
gcc_assert (mode != VOIDmode);
gcc_assert (GET_MODE (op->value) == VOIDmode
|| GET_MODE (op->value) == mode);
if (maybe_legitimize_operand_same_code (icode, opno, op))
return true;
op->value = copy_to_mode_reg (mode, op->value);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
break;
case EXPAND_CONVERT_TO:
gcc_assert (mode != VOIDmode);
op->value = convert_to_mode (mode, op->value, op->unsigned_p);
goto input;
case EXPAND_CONVERT_FROM:
if (GET_MODE (op->value) != VOIDmode)
mode = GET_MODE (op->value);
else
/* The caller must tell us what mode this value has. */
gcc_assert (mode != VOIDmode);
imode = insn_data[(int) icode].operand[opno].mode;
if (imode != VOIDmode && imode != mode)
{
op->value = convert_modes (imode, mode, op->value, op->unsigned_p);
mode = imode;
}
goto input;
case EXPAND_ADDRESS:
gcc_assert (mode != VOIDmode);
op->value = convert_memory_address (mode, op->value);
goto input;
case EXPAND_INTEGER:
mode = insn_data[(int) icode].operand[opno].mode;
if (mode != VOIDmode && const_int_operand (op->value, mode))
goto input;
break;
}
return insn_operand_matches (icode, opno, op->value);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
}
/* Make OP describe an input operand that should have the same value
as VALUE, after any mode conversion that the target might request.
TYPE is the type of VALUE. */
void
create_convert_operand_from_type (struct expand_operand *op,
rtx value, tree type)
{
create_convert_operand_from (op, value, TYPE_MODE (type),
TYPE_UNSIGNED (type));
}
/* Try to make operands [OPS, OPS + NOPS) match operands [OPNO, OPNO + NOPS)
of instruction ICODE. Return true on success, leaving the new operand
values in the OPS themselves. Emit no code on failure. */
bool
maybe_legitimize_operands (enum insn_code icode, unsigned int opno,
unsigned int nops, struct expand_operand *ops)
{
optabs.c: Use rtx_insn and rtx_code_label gcc/ * optabs.c (expand_doubleword_shift): Strengthen local "insn" from rtx to rtx_insn *. (expand_binop): Likewise for locals "entry_last", "last", "insns" (expand_twoval_unop): Likewise for locals entry_last", "last". (expand_twoval_binop): Likewise. (expand_twoval_binop_libfunc): Likewise for local "insns". (widen_leading): Likewise for local "last". (expand_doubleword_clz): Likewise for local "seq". Strengthen locals "hi0_label", "after_label" from rtx to rtx_code_label *. (widen_bswap): Strengthen local "last" from rtx to rtx_insn *. (expand_parity): Likewise for locals "last" and "seq". (expand_ffs): Likewise for local "seq". Strengthen local "nonzero_label" from rtx to rtx_code_label *. (expand_absneg_bit): Strengthen local "insns" from rtx to rtx_insn *. (expand_unop_direct): Likewise for local "last". (expand_unop): Likewise for locals "last", "insns". (expand_abs_nojump): Likewise for local "last". (expand_abs): Strengthen local "op1" from rtx to rtx_code_label *. (expand_one_cmpl_abs_nojump): Strengthen local "last" from rtx to rtx_insn *. (expand_copysign_absneg): Strengthen local "label" from rtx to rtx_code_label *. (expand_copysign_bit): Strengthen local "insns" from rtx to rtx_insn *. (struct no_conflict_data): Likewise for fields "first", "insn". (emit_libcall_block_1): Likewise for param "insns" and locals "next", "last", "insn". (emit_libcall_block): For now, add a checked cast to rtx_insn * on "insns" when invoking emit_libcall_block_1. Ultimately we want to strengthen insns itself. (prepare_cmp_insn): Strengthen local "last" from rtx to rtx_insn *. (emit_cmp_and_jump_insn_1): Likewise for local "insn". (prepare_float_lib_cmp): Likewise for local "insns". (emit_conditional_move): Likewise for local "last". (emit_conditional_add): Likewise. (have_sub2_insn): Likewise for local "seq". (expand_float): Likewise for local "insns". Strengthen locals "label", "neglabel" from rtx to rtx_code_label *. (expand_fix): Likewise for locals "last", "insn", "insns" (to rtx_insn *) and locals "lab1", "lab2" (to rtx_code_label *). (expand_fixed_convert): Likewise for local "insns" (to rtx_insn *). (expand_sfix_optab): Likewise for local "last". (expand_compare_and_swap_loop): Strengthen local "label" from rtx to rtx_code_label *. (maybe_emit_sync_lock_test_and_set): Strengthen local "last_insn" from rtx to rtx_insn *. (expand_atomic_fetch_op): Likewise for local "insn". (maybe_legitimize_operand_same_code): Likewise for local "last". (maybe_legitimize_operands): Likewise. From-SVN: r214355
2014-08-22 21:03:32 +02:00
rtx_insn *last;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
unsigned int i;
last = get_last_insn ();
for (i = 0; i < nops; i++)
if (!maybe_legitimize_operand (icode, opno + i, &ops[i]))
{
delete_insns_since (last);
return false;
}
return true;
}
/* Try to generate instruction ICODE, using operands [OPS, OPS + NOPS)
as its operands. Return the instruction pattern on success,
and emit any necessary set-up code. Return null and emit no
code on failure. */
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
rtx_insn *
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
maybe_gen_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
gcc_assert (nops == (unsigned int) insn_data[(int) icode].n_generator_args);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (!maybe_legitimize_operands (icode, 0, nops, ops))
Promote types of RTL expressions to more derived ones. * bb-reorder.c (set_edge_can_fallthru_flag): Use rtx_jump_insn where feasible. (fix_up_fall_thru_edges): Likewise. (fix_crossing_conditional_branches): Likewise. Promote jump targets from to rtx_insn to rtx_code_label where feasible. * bt-load.c (move_btr_def): Remove as-a cast of the value returned by gen_move_insn (returned type changed to rtx_insn). * builtins.c (expand_errno_check): Fix arguments of do_compare_rtx_and_jump (now expects rtx_code_label). (expand_builtin_acc_on_device): Likewise. * cfgcleanup.c (try_simplify_condjump): Add cast when calling invert_jump (now exprects rtx_jump_insn). * cfgexpand.c (label_rtx_for_bb): Promote return type to rtx_code_label. (construct_init_block): Use rtx_code_label. * cfgrtl.c (block_label): Promote return type to rtx_code_label. (try_redirect_by_replacing_jump): Use cast to rtx_jump_insn when calling redirect_jump. (patch_jump_insn): Likewise. (redirect_branch_edge): Likewise. (force_nonfallthru_and_redirect): Likewise. (fixup_reorder_chain): Explicitly use rtx_jump_insn instead of rtx_insn when suitable. (rtl_lv_add_condition_to_bb): Update call of do_compare_rtx_and_jump. * cfgrtl.h: Promote return type of block_label to rtx_code_label. * config/bfin/bfin.c (hwloop_optimize): Fix call of emit_label_before. * config/i386/i386.c (ix86_emit_cmove): Explicitly use rtx_code_label to store the value retured by gen_label_rtx. * config/mips/mips.c (mips16_split_long_branches): Promote rtx_insn to rtx_jump_insn. * config/sh/sh.c (gen_far_branch): Likewise. Fix call of invert_jump. (split_branches): Fix calls of redirect_jump. * dojump.c (jumpifnot): Promote argument type from rtx to rtx_code_label. (jumpifnot_1): Likewise. (jumpif): Likewise. (jumpif_1): Likewise. (do_jump_1): Likewise. (do_jump): Likewise. Use rtx_code_label when feasible. (do_jump_by_parts_greater_rtx): Likewise. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_compare_rtx_and_jump): Likewise. * dojump.h: Update function prototypes. * dse.c (emit_inc_dec_insn_before): Remove case (gen_move_insn now returns rtx_insn). * emit-rtl.c (emit_jump_insn_before_noloc): Promote return type to rtx_jump_insn. (emit_label_before): Likewise. (emit_jump_insn_after_noloc): Likewise. (emit_jump_insn_after_setloc): Likewise. (emit_jump_insn_after): Likewise (emit_jump_insn_before_setloc): Likewise. (emit_jump_insn_before): Likewise. (emit_label_before): Promote return type to rtx_code_label. (emit_label): Likewise. * except.c (sjlj_emit_dispatch_table): Use jump_target_rtx. * explow.c (emit_stack_save): Use gen_move_insn_uncast instead of gen_move_insn. (emit_stack_restore): Likewise. * expmed.c (emit_store_flag_force): Fix calls of do_compare_rtx_and_jump. (do_cmp_and_jump): Likewise. * expr.c (expand_expr_real_2): Likewise. Promote some local variables from rtx to rtx_code_label. (gen_move_insn_uncast): New function. * expr.h: Update return type of gen_move_insn (promote to rtx_insn). * function.c (convert_jumps_to_returns): Fix call of redirect_jump. * gcse.c (pre_insert_copy_insn): Use rtx_insn instead of rtx. * ifcvt.c (dead_or_predicable): Use rtx_jump_insn when calling invert_jump_1 and redirect_jump_1. * internal-fn.c (expand_arith_overflow_result_store): Fix call of do_compare_rtx_and_jump. (expand_addsub_overflow): Likewise. (expand_neg_overflow): Likewise. (expand_mul_overflow): Likewise. * ira.c (split_live_ranges_for_shrink_wrap): Use rtx_insn for return value of gen_move_insn. * jump.c (redirect_jump): Promote argument from rtx to rtx_jump_insn. * loop-doloop.c (add_test): Use rtx_code_label. (doloop_modify): Likewise. (doloop_optimize): Likewise. * loop-unroll.c (compare_and_jump_seq): Promote rtx to rtx_code_label. * lra-constraints.c (emit_spill_move): Remove cast of value returned by gen_move_insn. (inherit_reload_reg): Add cast when calling dump_insn_slim. (split_reg): Likewise. * modulo-sched.c (schedule_reg_moves): Remove cast of value returned by gen_move_insn. * optabs.c (expand_binop_directly): Remove casts of values returned by maybe_gen_insn. (expand_unop_direct): Likewise. (expand_abs): Likewise. (maybe_emit_unop_insn): Likewise. (maybe_gen_insn): Promote return type to rtx_insn. * optabs.h: Update prototype of maybe_gen_insn. * postreload-gcse.c (eliminate_partially_redundant_load): Remove redundant cast. * recog.c (struct peep2_insn_data): Promote type of insn field to rtx_insn. (peep2_reinit_state): Use NULL instead of NULL_RTX. (peep2_attempt): Remove casts of insn in peep2_insn_data. (peep2_fill_buffer): Promote argument from rtx to rtx_insn * recog.h (struct insn_gen_fn): Promote return types of function pointers and operator ().from rtx to rtx_insn. * reorg.c (fill_simple_delay_slots): Promote rtx_insn to rtx_jump_insn. (fill_eager_delay_slots): Likewise. (relax_delay_slots): Likewise. (make_return_insns): Likewise. (dbr_schedule): Likewise. (optimize_skips): Likewise. (reorg_redirect_jump): Likewise. (fill_slots_from_thread): Likewise. * reorg.h: Update prototypes. * resource.c (find_dead_or_set_registers): Use dyn_cast to rtx_jump_insn instead of check. Use it's jump_target method. * rtl.h (rtx_jump_insn::jump_label): Define new method. (rtx_jump_insn::jump_target): Define new method. (rtx_jump_insn::set_jump_target): Define new method. * rtlanal.c (tablejump_p): Promote type of one local variable. * sched-deps.c (sched_analyze_2): Promote rtx to rtx_insn_list. (sched_analyze_insn): Likewise. * sched-vis.c (print_insn_with_notes): Promote rtx to rtx_insn. (print_insn): Likewise. * stmt.c (label_rtx): Promote return type to rtx_insn. (force_label_rtx): Likewise. (jump_target_rtx): Define new function. (expand_label): Use it, get rid of one cast. (expand_naked_return): Promote rtx to rtx_code_label. (do_jump_if_equal): Fix do_compare_rtx_and_jump call. (expand_case): Use rtx_code_label instread of rtx where feasible. (expand_sjlj_dispatch_table): Likewise. (emit_case_nodes): Likewise. * stmt.h: Declare jump_target_rtx. Update prototypes. Fix comments. * store-motion.c (insert_store): Make use of new return type of gen_move_insn and remove a cast. (replace_store_insn): Likewise. From-SVN: r223454
2015-05-20 21:39:42 +02:00
return NULL;
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
switch (nops)
{
case 1:
return GEN_FCN (icode) (ops[0].value);
case 2:
return GEN_FCN (icode) (ops[0].value, ops[1].value);
case 3:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value);
case 4:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value);
case 5:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value);
case 6:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value, ops[5].value);
case 7:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value, ops[5].value,
ops[6].value);
case 8:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value, ops[5].value,
ops[6].value, ops[7].value);
case 9:
return GEN_FCN (icode) (ops[0].value, ops[1].value, ops[2].value,
ops[3].value, ops[4].value, ops[5].value,
ops[6].value, ops[7].value, ops[8].value);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
}
gcc_unreachable ();
}
/* Try to emit instruction ICODE, using operands [OPS, OPS + NOPS)
as its operands. Return true on success and emit no code on failure. */
bool
maybe_expand_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
rtx_insn *pat = maybe_gen_insn (icode, nops, ops);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (pat)
{
emit_insn (pat);
return true;
}
return false;
}
/* Like maybe_expand_insn, but for jumps. */
bool
maybe_expand_jump_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
rtx_insn *pat = maybe_gen_insn (icode, nops, ops);
optabs.h (emit_unop_insn, [...]): Change insn code parameter from "int" to "enum insn_code". gcc/ * optabs.h (emit_unop_insn, maybe_emit_unop_insn): Change insn code parameter from "int" to "enum insn_code". (expand_operand_type): New enum. (expand_operand): New structure. (create_expand_operand): New function. (create_fixed_operand, create_output_operand): Likewise (create_input_operand, create_convert_operand_to): Likewise. (create_convert_operand_from, create_address_operand): Likewise. (create_integer_operand): Likewise. (create_convert_operand_from_type, maybe_legitimize_operands): Declare. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * builtins.c (expand_builtin_prefetch): Use the new interfaces. (expand_builtin_interclass_mathfn, expand_builtin_strlen): Likewise. (expand_movstr, expand_builtin___clear_cache): Likewise. (expand_builtin_lock_release): Likewise. * explow.c (allocate_dynamic_stack_space): Likewise. (probe_stack_range): Likewise. Allow check_stack to FAIL, and use the default handling in that case. * expmed.c (check_predicate_volatile_ok): Delete. (store_bit_field_1, extract_bit_field_1): Use the new interfaces. (emit_cstore): Likewise. * expr.c (emit_block_move_via_movmem): Likewise. (set_storage_via_setmem, expand_assignment): Likewise. (emit_storent_insn, try_casesi): Likewise. (emit_single_push_insn): Likewise. Allow the expansion to fail. * optabs.c (expand_widen_pattern_expr, expand_ternary_op): Likewise. (expand_vec_shift_expr, expand_binop_directly): Likewise. (expand_twoval_unop, expand_twoval_binop): Likewise. (expand_unop_direct, emit_indirect_jump): Likewise. (emit_conditional_move, vector_compare_rtx): Likewise. (expand_vec_cond_expr, expand_val_compare_and_swap_1): Likewise. (expand_sync_operation, expand_sync_fetch_operation): Likewise. (expand_sync_lock_test_and_set): Likewise. (maybe_emit_unop_insn): Likewise. Change icode to an insn_code. (emit_unop_insn): Likewise. (expand_copysign_absneg): Change icode to an insn_code. (create_convert_operand_from_type): New function. (maybe_legitimize_operand, maybe_legitimize_operands): Likewise. (maybe_gen_insn, maybe_expand_insn, maybe_expand_jump_insn): Likewise. (expand_insn, expand_jump_insn): Likewise. * config/i386/i386.md (setmem<mode>): Use nonmemory_operand rather than const_int_operand for operand 2. From-SVN: r171341
2011-03-23 10:30:58 +01:00
if (pat)
{
emit_jump_insn (pat);
return true;
}
return false;
}
/* Emit instruction ICODE, using operands [OPS, OPS + NOPS)
as its operands. */
void
expand_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
if (!maybe_expand_insn (icode, nops, ops))
gcc_unreachable ();
}
/* Like expand_insn, but for jumps. */
void
expand_jump_insn (enum insn_code icode, unsigned int nops,
struct expand_operand *ops)
{
if (!maybe_expand_jump_insn (icode, nops, ops))
gcc_unreachable ();
}
re PR middle-end/14311 (builtins for atomic operations needed) PR middle-end/14311 * builtin-types.def (BT_BOOL, BT_VOLATILE_PTR, BT_I1, BT_I2, BT_I4, BT_I8, BT_FN_VOID_VPTR, BT_FN_I1_VPTR_I1, BT_FN_I2_VPTR_I2, BT_FN_I4_VPTR_I4, BT_FN_I8_VPTR_I8, BT_FN_BOOL_VPTR_I1_I1, BT_FN_BOOL_VPTR_I2_I2, BT_FN_BOOL_VPTR_I4_I4, BT_FN_BOOL_VPTR_I8_I8, BT_FN_I1_VPTR_I1_I1, BT_FN_I2_VPTR_I2_I2, BT_FN_I4_VPTR_I4_I4, BT_FN_I8_VPTR_I8_I8): New. * builtins.def (DEF_SYNC_BUILTIN): New. (BUILT_IN_FETCH_AND_ADD_N, BUILT_IN_FETCH_AND_ADD_1, BUILT_IN_FETCH_AND_ADD_2, BUILT_IN_FETCH_AND_ADD_4, BUILT_IN_FETCH_AND_ADD_8, BUILT_IN_FETCH_AND_SUB_N, BUILT_IN_FETCH_AND_SUB_1, BUILT_IN_FETCH_AND_SUB_2, BUILT_IN_FETCH_AND_SUB_4, BUILT_IN_FETCH_AND_SUB_8, BUILT_IN_FETCH_AND_OR_N, BUILT_IN_FETCH_AND_OR_1, BUILT_IN_FETCH_AND_OR_2, BUILT_IN_FETCH_AND_OR_4, BUILT_IN_FETCH_AND_OR_8, BUILT_IN_FETCH_AND_AND_N, BUILT_IN_FETCH_AND_AND_1, BUILT_IN_FETCH_AND_AND_2, BUILT_IN_FETCH_AND_AND_4, BUILT_IN_FETCH_AND_AND_8, BUILT_IN_FETCH_AND_XOR_N, BUILT_IN_FETCH_AND_XOR_1, BUILT_IN_FETCH_AND_XOR_2, BUILT_IN_FETCH_AND_XOR_4, BUILT_IN_FETCH_AND_XOR_8, BUILT_IN_FETCH_AND_NAND_N, BUILT_IN_FETCH_AND_NAND_1, BUILT_IN_FETCH_AND_NAND_2, BUILT_IN_FETCH_AND_NAND_4, BUILT_IN_FETCH_AND_NAND_8, BUILT_IN_ADD_AND_FETCH_N, BUILT_IN_ADD_AND_FETCH_1, BUILT_IN_ADD_AND_FETCH_2, BUILT_IN_ADD_AND_FETCH_4, BUILT_IN_ADD_AND_FETCH_8, BUILT_IN_SUB_AND_FETCH_N, BUILT_IN_SUB_AND_FETCH_1, BUILT_IN_SUB_AND_FETCH_2, BUILT_IN_SUB_AND_FETCH_4, BUILT_IN_SUB_AND_FETCH_8, BUILT_IN_OR_AND_FETCH_N, BUILT_IN_OR_AND_FETCH_1, BUILT_IN_OR_AND_FETCH_2, BUILT_IN_OR_AND_FETCH_4, BUILT_IN_OR_AND_FETCH_8, BUILT_IN_AND_AND_FETCH_N, BUILT_IN_AND_AND_FETCH_1, BUILT_IN_AND_AND_FETCH_2, BUILT_IN_AND_AND_FETCH_4, BUILT_IN_AND_AND_FETCH_8, BUILT_IN_XOR_AND_FETCH_N, BUILT_IN_XOR_AND_FETCH_1, BUILT_IN_XOR_AND_FETCH_2, BUILT_IN_XOR_AND_FETCH_4, BUILT_IN_XOR_AND_FETCH_8, BUILT_IN_NAND_AND_FETCH_N, BUILT_IN_NAND_AND_FETCH_1, BUILT_IN_NAND_AND_FETCH_2, BUILT_IN_NAND_AND_FETCH_4, BUILT_IN_NAND_AND_FETCH_8, BUILT_IN_BOOL_COMPARE_AND_SWAP_N, BUILT_IN_BOOL_COMPARE_AND_SWAP_1, BUILT_IN_BOOL_COMPARE_AND_SWAP_2, BUILT_IN_BOOL_COMPARE_AND_SWAP_4, BUILT_IN_BOOL_COMPARE_AND_SWAP_8, BUILT_IN_VAL_COMPARE_AND_SWAP_N, BUILT_IN_VAL_COMPARE_AND_SWAP_1, BUILT_IN_VAL_COMPARE_AND_SWAP_2, BUILT_IN_VAL_COMPARE_AND_SWAP_4, BUILT_IN_VAL_COMPARE_AND_SWAP_8, BUILT_IN_LOCK_TEST_AND_SET_N, BUILT_IN_LOCK_TEST_AND_SET_1, BUILT_IN_LOCK_TEST_AND_SET_2, BUILT_IN_LOCK_TEST_AND_SET_4, BUILT_IN_LOCK_TEST_AND_SET_8, BUILT_IN_LOCK_RELEASE_N, BUILT_IN_LOCK_RELEASE_1, BUILT_IN_LOCK_RELEASE_2, BUILT_IN_LOCK_RELEASE_4, BUILT_IN_LOCK_RELEASE_8, BUILT_IN_SYNCHRONIZE: New. * builtins.c (called_as_built_in): Rewrite from CALLED_AS_BUILT_IN as a function. Accept __sync_ as a prefix as well. (expand_builtin_sync_operation, expand_builtin_compare_and_swap, expand_builtin_lock_test_and_set, expand_builtin_synchronize, expand_builtin_lock_release): New. (expand_builtin): Call them. * c-common.c (DEF_BUILTIN): Don't require __builtin_ prefix if neither BOTH_P nor FALLBACK_P are defined. (builtin_type_for_size): New. (sync_resolve_size, sync_resolve_params, sync_resolve_return): New. (resolve_overloaded_builtin): New. * c-common.h (resolve_overloaded_builtin): Declare. (builtin_type_for_size): Declare. * c-typeck.c (build_function_call): Invoke resolve_overloaded_builtin. * expr.c (sync_add_optab, sync_sub_optab, sync_ior_optab, sync_and_optab, sync_xor_optab, sync_nand_optab, sync_old_add_optab, sync_old_sub_optab, sync_old_ior_optab, sync_old_and_optab, sync_old_xor_optab, sync_old_nand_optab, sync_new_add_optab, sync_new_sub_optab, sync_new_ior_optab, sync_new_and_optab, sync_new_xor_optab, sync_new_nand_optab, sync_compare_and_swap, sync_compare_and_swap_cc, sync_lock_test_and_set, sync_lock_release): New. * optabs.h: Declare them. * expr.h (expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): Declare. * genopinit.c (optabs): Add sync optabs. * optabs.c (init_optabs): Initialize sync optabs. (expand_val_compare_and_swap_1, expand_val_compare_and_swap, expand_bool_compare_and_swap, expand_compare_and_swap_loop, expand_sync_operation, expand_sync_fetch_operation, expand_sync_lock_test_and_set): New. * doc/extend.texi (Atomic Builtins): New section * doc/md.texi (Standard Names): Add sync patterns. From-SVN: r98154
2005-04-15 01:37:47 +02:00
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
/* Reduce conditional compilation elsewhere. */
/* Enumerates the possible types of structure operand to an
extraction_insn. */
enum extraction_type { ET_unaligned_mem, ET_reg };
/* Check whether insv, extv or extzv pattern ICODE can be used for an
insertion or extraction of type TYPE on a structure of mode MODE.
Return true if so and fill in *INSN accordingly. STRUCT_OP is the
operand number of the structure (the first sign_extract or zero_extract
operand) and FIELD_OP is the operand number of the field (the other
side of the set from the sign_extract or zero_extract). */
static bool
get_traditional_extraction_insn (extraction_insn *insn,
enum extraction_type type,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode,
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
enum insn_code icode,
int struct_op, int field_op)
{
const struct insn_data_d *data = &insn_data[icode];
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode struct_mode = data->operand[struct_op].mode;
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
if (struct_mode == VOIDmode)
struct_mode = word_mode;
if (mode != struct_mode)
return false;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode field_mode = data->operand[field_op].mode;
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
if (field_mode == VOIDmode)
field_mode = word_mode;
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode pos_mode = data->operand[struct_op + 2].mode;
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
if (pos_mode == VOIDmode)
pos_mode = word_mode;
insn->icode = icode;
insn->field_mode = field_mode;
insn->struct_mode = (type == ET_unaligned_mem ? byte_mode : struct_mode);
insn->pos_mode = pos_mode;
return true;
}
/* Return true if an optab exists to perform an insertion or extraction
of type TYPE in mode MODE. Describe the instruction in *INSN if so.
REG_OPTAB is the optab to use for register structures and
MISALIGN_OPTAB is the optab to use for misaligned memory structures.
POS_OP is the operand number of the bit position. */
static bool
get_optab_extraction_insn (struct extraction_insn *insn,
enum extraction_type type,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode, direct_optab reg_optab,
direct_optab misalign_optab, int pos_op)
{
direct_optab optab = (type == ET_unaligned_mem ? misalign_optab : reg_optab);
enum insn_code icode = direct_optab_handler (optab, mode);
if (icode == CODE_FOR_nothing)
return false;
const struct insn_data_d *data = &insn_data[icode];
insn->icode = icode;
insn->field_mode = mode;
insn->struct_mode = (type == ET_unaligned_mem ? BLKmode : mode);
insn->pos_mode = data->operand[pos_op].mode;
if (insn->pos_mode == VOIDmode)
insn->pos_mode = word_mode;
return true;
}
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
/* Return true if an instruction exists to perform an insertion or
extraction (PATTERN says which) of type TYPE in mode MODE.
Describe the instruction in *INSN if so. */
static bool
get_extraction_insn (extraction_insn *insn,
enum extraction_pattern pattern,
enum extraction_type type,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode)
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
{
switch (pattern)
{
case EP_insv:
if (targetm.have_insv ()
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
&& get_traditional_extraction_insn (insn, type, mode,
targetm.code_for_insv, 0, 3))
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
return true;
return get_optab_extraction_insn (insn, type, mode, insv_optab,
insvmisalign_optab, 2);
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
case EP_extv:
if (targetm.have_extv ()
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
&& get_traditional_extraction_insn (insn, type, mode,
targetm.code_for_extv, 1, 0))
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
return true;
return get_optab_extraction_insn (insn, type, mode, extv_optab,
extvmisalign_optab, 3);
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
case EP_extzv:
if (targetm.have_extzv ()
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
&& get_traditional_extraction_insn (insn, type, mode,
targetm.code_for_extzv, 1, 0))
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
return true;
return get_optab_extraction_insn (insn, type, mode, extzv_optab,
extzvmisalign_optab, 3);
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
default:
gcc_unreachable ();
}
}
/* Return true if an instruction exists to access a field of mode
FIELDMODE in a structure that has STRUCT_BITS significant bits.
Describe the "best" such instruction in *INSN if so. PATTERN and
TYPE describe the type of insertion or extraction we want to perform.
For an insertion, the number of significant structure bits includes
all bits of the target. For an extraction, it need only include the
most significant bit of the field. Larger widths are acceptable
in both cases. */
static bool
get_best_extraction_insn (extraction_insn *insn,
enum extraction_pattern pattern,
enum extraction_type type,
unsigned HOST_WIDE_INT struct_bits,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode field_mode)
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
{
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode mode = smallest_mode_for_size (struct_bits, MODE_INT);
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
while (mode != VOIDmode)
{
if (get_extraction_insn (insn, pattern, type, mode))
{
while (mode != VOIDmode
&& GET_MODE_SIZE (mode) <= GET_MODE_SIZE (field_mode)
&& !TRULY_NOOP_TRUNCATION_MODES_P (insn->field_mode,
field_mode))
{
get_extraction_insn (insn, pattern, type, mode);
mode = GET_MODE_WIDER_MODE (mode);
}
return true;
}
mode = GET_MODE_WIDER_MODE (mode);
}
return false;
}
/* Return true if an instruction exists to access a field of mode
FIELDMODE in a register structure that has STRUCT_BITS significant bits.
Describe the "best" such instruction in *INSN if so. PATTERN describes
the type of insertion or extraction we want to perform.
For an insertion, the number of significant structure bits includes
all bits of the target. For an extraction, it need only include the
most significant bit of the field. Larger widths are acceptable
in both cases. */
bool
get_best_reg_extraction_insn (extraction_insn *insn,
enum extraction_pattern pattern,
unsigned HOST_WIDE_INT struct_bits,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode field_mode)
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
{
return get_best_extraction_insn (insn, pattern, ET_reg, struct_bits,
field_mode);
}
/* Return true if an instruction exists to access a field of BITSIZE
bits starting BITNUM bits into a memory structure. Describe the
"best" such instruction in *INSN if so. PATTERN describes the type
of insertion or extraction we want to perform and FIELDMODE is the
natural mode of the extracted field.
The instructions considered here only access bytes that overlap
the bitfield; they do not touch any surrounding bytes. */
bool
get_best_mem_extraction_insn (extraction_insn *insn,
enum extraction_pattern pattern,
HOST_WIDE_INT bitsize, HOST_WIDE_INT bitnum,
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
machine_mode field_mode)
Makefile.in (recog.o): Add insn-codes.h. gcc/ * Makefile.in (recog.o): Add insn-codes.h. * expr.h (extraction_pattern): Move to optabs.h. (mode_for_extraction): Delete. * optabs.h (extraction_insn): New structure. (extraction_pattern): Moved from expr.h. (get_best_reg_extraction_insn, get_best_mem_extraction_insn): Declare. * optabs.c (HAVE_insv, CODE_FOR_insv, HAVE_extv, CODE_FOR_extv) (HAVE_extzv, CODE_FOR_extzv): Provide defaults. (extraction_type): New enum. (get_traditional_extraction_insn, get_extraction_insn) (get_best_reg_extraction_insn, get_best_mem_extraction_insn): New functions. * combine.c (make_extraction): Use get_best_reg_extraction_insn instead of mode_for_extraction. * expmed.c (HAVE_insv, CODE_FOR_insv, gen_insv, HAVE_extv) (CODE_FOR_extv, gen_extv, HAVE_extzv, CODE_FOR_extzv, gen_extzv): Remove fallback definitions. (mode_for_extraction): Delete. (adjust_bit_field_mem_for_reg): New function. (store_bit_field_using_insv): Replace OP_MODE parameter with an extraction_insn. Pass struct_mode to narrow_bit_field_mem. (extract_bit_field_using_extv): Likewise EXT_MODE. (store_bit_field_1): Use get_best_reg_extraction_insn and get_best_mem_extraction_insn instead of mode_for_extraction. Use adjust_bit_field_mem_for_reg when forcing memory to a register and doing a register insertion. Update calls to store_bit_field_using_insv. (extract_bit_field_1): Likewise extractions and calls to extract_bit_field_using_extv. (store_Bit_field): When narrowing to a bitregion, don't use the insv mode as a limit. * recog.c: (HAVE_extv, CODE_FOR_extv, HAVE_extzv, CODE_FOR_extzv): Provide defaults. (simplify_while_replacing): Use insn_data instead of mode_for_extraction. From-SVN: r193605
2012-11-18 18:33:38 +01:00
{
unsigned HOST_WIDE_INT struct_bits = (bitnum % BITS_PER_UNIT
+ bitsize
+ BITS_PER_UNIT - 1);
struct_bits -= struct_bits % BITS_PER_UNIT;
return get_best_extraction_insn (insn, pattern, ET_unaligned_mem,
struct_bits, field_mode);
}
/* Determine whether "1 << x" is relatively cheap in word_mode. */
bool
lshift_cheap_p (bool speed_p)
{
/* FIXME: This should be made target dependent via this "this_target"
mechanism, similar to e.g. can_copy_init_p in gcse.c. */
static bool init[2] = { false, false };
static bool cheap[2] = { true, true };
/* If the targer has no lshift in word_mode, the operation will most
probably not be cheap. ??? Does GCC even work for such targets? */
if (optab_handler (ashl_optab, word_mode) == CODE_FOR_nothing)
return false;
if (!init[speed_p])
{
rtx reg = gen_raw_REG (word_mode, 10000);
int cost = set_src_cost (gen_rtx_ASHIFT (word_mode, const1_rtx, reg),
target.def (rtx_costs): Remove "code" param, add "mode". * target.def (rtx_costs): Remove "code" param, add "mode". * rtl.h (rtx_cost, get_full_rtx_cost): Update prototype. (set_src_cost, get_full_set_src_cost): Likewise. Move later in file. (set_rtx_cost, get_full_set_rtx_cost): Move later in file. * rtlanal.c (rtx_cost): Add "mode" parameter. Update targetm.rtx_costs call. Track mode when given in rtx. (get_full_rtx_cost): Add "mode" parameter. Update rtx_cost calls. (default_address_cost): Pass Pmode to rtx_cost. (insn_rtx_cost): Pass dest mode of set to set_src_cost. * cprop.c (try_replace_reg): Ensure set_rtx_cost is not called with NULL set. * cse.c (COST, COST_IN): Add MODE param. Update all uses. (notreg_cost): Add mode param. Use it. * gcse.c (want_to_gcse_p): Delete forward declaration. Add mode param and pass to set_src_cost. Update all calls. (hash_scan_set): Formatting. * hooks.c (hook_bool_rtx_int_int_int_intp_bool_false): Delete. (hook_bool_rtx_mode_int_int_intp_bool_false): New function. * hooks.h: Ditto. * expmed.c (init_expmed_one_conv, init_expmed_one_mode, init_expmed, expand_mult, mult_by_coeff_cost, expand_smod_pow2, emit_store_flag): Update set_src_cost and rtx_cost calls. * auto-inc-dec.c (attempt_change): Likewise. * calls.c (precompute_register_parameters): Likewise. * combine.c (expand_compound_operation, make_extraction, force_to_mode, distribute_and_simplify_rtx): Likewise. * dojump.c (prefer_and_bit_test): Likewise. * dse.c (find_shift_sequence): Likewise. * expr.c (compress_float_constant): Likewise. * fwprop.c (should_replace_address, try_fwprop_subst): Likewise. * ifcvt.c (noce_try_sign_mask): Likewise. * loop-doloop.c (doloop_optimize): Likewise. * loop-invariant.c (create_new_invariant): Likewise. * lower-subreg.c (shift_cost, compute_costs): Likewise. * optabs.c (avoid_expensive_constant, prepare_cmp_insn, lshift_cheap_p): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, try_replace_in_use, reload_cse_move2add): Likewise. * reload1.c (calculate_elim_costs_all_insns, note_reg_elim_costly): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. * tree-ssa-loop-ivopts.c (computation_cost): Likewise. * tree-ssa-reassoc.c (optimize_range_tests_to_bit_test): Likewise. * tree-switch-conversion.c (emit_case_bit_tests): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_costs): Delete "code" param, add "mode" param. Use "mode: in place of GET_MODE (x). Pass mode to rtx_cost calls. * config/alpha/alpha.c (alpha_rtx_costs): Likewise. * config/arc/arc.c (arc_rtx_costs): Likewise. * config/arm/arm.c (arm_rtx_costs): Likewise. * config/avr/avr.c (avr_rtx_costs, avr_rtx_costs_1): Likewise. * config/bfin/bfin.c (bfin_rtx_costs): Likewise. * config/c6x/c6x.c (c6x_rtx_costs): Likewise. * config/cris/cris.c (cris_rtx_costs): Likewise. * config/epiphany/epiphany.c (epiphany_rtx_costs): Likewise. * config/frv/frv.c (frv_rtx_costs): Likewise. * config/h8300/h8300.c (h8300_rtx_costs): Likewise. * config/i386/i386.c (ix86_rtx_costs): Likewise. * config/ia64/ia64.c (ia64_rtx_costs): Likewise. * config/iq2000/iq2000.c (iq2000_rtx_costs): Likewise. * config/lm32/lm32.c (lm32_rtx_costs): Likewise. * config/m32c/m32c.c (m32c_rtx_costs): Likewise. * config/m32r/m32r.c (m32r_rtx_costs): Likewise. * config/m68k/m68k.c (m68k_rtx_costs): Likewise. * config/mcore/mcore.c (mcore_rtx_costs): Likewise. * config/mep/mep.c (mep_rtx_cost): Likewise. * config/microblaze/microblaze.c (microblaze_rtx_costs): Likewise. * config/mips/mips.c (mips_rtx_costs): Likewise. * config/mmix/mmix.c (mmix_rtx_costs): Likewise. * config/mn10300/mn10300.c (mn10300_rtx_costs): Likewise. * config/msp430/msp430.c (msp430_rtx_costs): Likewise. * config/nds32/nds32-cost.c (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32-protos.h (nds32_rtx_costs_impl): Likewise. * config/nds32/nds32.c (nds32_rtx_costs): Likewise. * config/nios2/nios2.c (nios2_rtx_costs): Likewise. * config/pa/pa.c (hppa_rtx_costs): Likewise. * config/pdp11/pdp11.c (pdp11_rtx_costs): Likewise. * config/rl78/rl78.c (rl78_rtx_costs): Likewise. * config/rs6000/rs6000.c (rs6000_rtx_costs): Likewise. * config/s390/s390.c (s390_rtx_costs): Likewise. * config/sh/sh.c (sh_rtx_costs): Likewise. * config/sparc/sparc.c (sparc_rtx_costs): Likewise. * config/spu/spu.c (spu_rtx_costs): Likewise. * config/stormy16/stormy16.c (xstormy16_rtx_costs): Likewise. * config/tilegx/tilegx.c (tilegx_rtx_costs): Likewise. * config/tilepro/tilepro.c (tilepro_rtx_costs): Likewise. * config/v850/v850.c (v850_rtx_costs): Likewise. * config/vax/vax.c (vax_rtx_costs): Likewise. * config/visium/visium.c (visium_rtx_costs): Likewise. * config/xtensa/xtensa.c (xtensa_rtx_costs): Likewise. * config/aarch64/aarch64.c (aarch64_rtx_mult_cost): Change type of "code" param, and pass as outer_code to first rtx_cost call. Pass mode to rtx_cost calls. (aarch64_address_cost, aarch64_if_then_else_costs): Update rtx_cost calls. (aarch64_rtx_costs_wrapper): Update. * config/arm/arm.c (arm_rtx_costs_1, arm_size_rtx_costs, arm_unspec_cost, arm_new_rtx_costs, arm_slowmul_rtx_costs): Update rtx_cost calls. * config/avr/avr.c (avr_final_prescan_insn): Update set_src_cost and rtx_cost calls. (avr_operand_rtx_cost): Similarly. (avr_rtx_costs_1): Correct mode passed to avr_operand_rtx_cost for subexpressions of ZERO_EXTEND, SIGN_EXTEND and COMPARE. * config/mips/mips.c (mips_stack_address_p): Comment typo. (mips_binary_cost): Update rtx_cost and set_src_cost calls. (mips_rtx_costs): Use GET_MODE (x) to detect const_int. * config/mn10300/mn10300.c (mn10300_address_cost): Pass Pmode to rtx_cost. (mn10300_rtx_costs): Correct mode passed to mn10300_address_cost. * config/rs6000/rs6000.c (rs6000_debug_rtx_costs): Update. * config/sh/sh.c (and_xor_ior_costs): Update rtx_cost call. * doc/tm.texi: Regenerate. From-SVN: r225532
2015-07-08 05:02:27 +02:00
word_mode, speed_p);
cheap[speed_p] = cost < COSTS_N_INSNS (3);
init[speed_p] = true;
}
return cheap[speed_p];
}
#include "gt-optabs.h"