gcc/gcc/optabs.c

7334 lines
219 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.
2000-02-26 14:55:09 +01:00
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
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
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
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
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"
#include "tm.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"
#include "tree.h"
#include "tm_p.h"
1991-12-30 04:19:53 +01:00
#include "flags.h"
#include "function.h"
#include "except.h"
1991-12-30 04:19:53 +01:00
#include "expr.h"
expr.h: Split out optab- and libfunc-related code to... * expr.h: Split out optab- and libfunc-related code to... * optabs.h, libfuncs.h: ... these new headers. * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. (OPTABS_H): New. (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to dependencies. * mkconfig.sh: Don't include insn-codes.h from config.h. * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether enum insn_code is available. Move reload_in_optab and reload_out_optab array declarations to optabs.h. * regmove.c (gen_add3_insn): Move to optabs.c, export from there, prototype in expr.h. * gencodes.c: Cleanup: zap global variables, don't use printf where puts will do, don't bother defining MAX_INSN_CODE which nothing uses, let CODE_FOR_nothing get its value implicitly. * genemit.c, genopinit.c: Include optabs.h in generated file. * genoutput.c: Include insn-codes.h in generated file. * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: Include optabs.h. * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, config/m88k/m88k.c, config/sparc/sparc.c: Include libfuncs.h. * reload.c: Include expr.h and optabs.h before reload.h. * config/alpha/alpha.c: Include tree.h before reload.h. * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, and reload.h in that order. * config/sparc/sparc.c: Include debug.h. * recog.c: Include insn-codes.h. cp: * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. * except.c: Include libfuncs.h. java: * Make-lang.in (java/decl.o): Update dependencies. * decl.c: Include libfuncs.h, don't include toplev.h. From-SVN: r44858
2001-08-13 17:56:51 +02:00
#include "optabs.h"
#include "libfuncs.h"
1991-12-30 04:19:53 +01:00
#include "recog.h"
1993-04-05 00:14:12 +02:00
#include "reload.h"
Makefile.in (tree.o): Depend on ggc.h. * Makefile.in (tree.o): Depend on ggc.h. (varasm.o): Likewise. (function.o): Likewise. (stmt.o): Likewise. (except.o): Likewise. (optabs.o): Likewise. (emit-rtl.o): Likewise. * emit-rtl.c: Include ggc.h. (sequence_element_free_list): Remove, and all references. (mark_sequence): New functions. (mark_emit_state): New function. * except.c: Include ggc.h. (mark_eh_node, mark_eh_stack, mark_eh_queue): New functions. (mark_tree_label_node): New functions. (mark_eh_state): New function. * function.c: Include ggc.h. (mark_temp_slot, mark_function_chain): New functions. (mark_function_state): New function. (init_function_once): New function. * function.h (init_function_once): New function. * ggc-callbacks.c (lang_mark_false_label_stack): New function. * ggc.h (label_node): Declare. (eh_status, emit_status, stmt_status, varasm_status): Likewise. (lang_mark_false_label_stack): New function. (mark_temp_slot): Remove declaration. (mark_function_chain): Likewise. (mark_eh_state): Adjust prototype. (mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab): Likewise. * optabs.c: Include ggc.h. (mark_optab): New function. (init_optabs): Add gc roots. * stmt.c: Include ggc.h. (mark_cond_nesting, mark_loop_nesting): New functions. (mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise. (mark_stmt_state): New function. * toplev.c (compile_file): Call init_function_once. * tree.c: Include ggc.h. (type_hash): Move declaration earlier in file. (TYPE_HASH_SIZE, type_hash_table): Likewise. (init_obstacks): Add gc roots. (mark_type_hash): New function. * varasm.c: Include ggc.h. (mark_pool_constant): New function. (mark_varasm_state): New function. Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk> Co-Authored-By: Mark Mitchell <mark@codesourcery.com> From-SVN: r29119
1999-09-05 04:41:35 +02:00
#include "ggc.h"
#include "basic-block.h"
target.h (init_libfuncs): New hook. * target.h (init_libfuncs): New hook. * target-def.h: Default TARGET_INIT_BUILTINS and TARGET_INIT_LIBFUNCS to hook_void_void. Add TARGET_INIT_LIBFUNCS to TARGET_INITIALIZER. * builtins.c (default_init_builtins): Delete. * expr.h (default_init_builtins): Delete prototype. * doc/tm.texi: Document TARGET_INIT_LIBFUNCS and US_SOFTWARE_GOFAST. Tweak documentation of TARGET_FLOAT_LIB_COMPARE_RETURNS_BOOL. Remove documentation of INIT_TARGET_OPTABS, MULSI3_LIBCALL, DIVSI3_LIBCALL, UDIVSI3_LIBCALL, MODSI3_LIBCALL, UMODSI3_LIBCALL, MULDI3_LIBCALL, DIVDI3_LIBCALL, UDIVDI3_LIBCALL, MODDI3_LIBCALL, and UMODDI3_LIBCALL, * Makefile.in (optabs.o): Depends on target.h. * defaults.h: Provide default for FLOAT_LIB_COMPARE_RETURNS_BOOL. * optabs.c: Include target.h. (prepare_float_lib_cmp): No need for #ifdef around use of FLOAT_LIB_COMPARE_RETURNS_BOOL. (set_optab_libfunc): New function. (init_optabs): Delete use of all *_LIBCALL defines. Call targetm.init_libfuncs not INIT_TARGET_OPTABS. * optabs.h: Prototype set_optab_libfunc. * config.gcc: Remove all references to pa/long_double.h, ia64/hpux_longdouble.h, and gofast.h. (mips-*-*): When --enable-gofast, just add US_SOFTWARE_GOFAST to tm_defines; don't set INIT_SUBTARGET_OPTABS or change tm_file. * config/alpha/alpha.c, config/c4x/c4x.c, config/cris/cris.c * config/frv/frv.c, config/h8300/h8300.c, config/i860/i860.c * config/ia64/ia64.c, config/ip2k/ip2k.c, config/m68hc11/m68hc11.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c, config/vax/vax.c: Provide a definition for TARGET_INIT_LIBFUNCS. Where necessary, include optabs.h, libfuncs.h, and/or config/gofast.h. * config/alpha/unicosmk.h, config/alpha/vms.h, config/c4x/c4x.h * config/avr/avr.h, config/cris/cris.h, config/frv/frv.h * config/h8300/h8300.h, config/i860/i860.h, config/ip2k/ip2k.h * config/iq2000/iq2000.h, config/m68hc11/m68hc11.h, config/mips/mips.h * config/rs6000/aix.h, config/rs6000/sysv4.h, config/sparc/elf.h * config/sparc/lite.h, config/sparc/netbsd-elf.h, config/sparc/sol2.h * config/sparc/sparc.h, config/v850/v850.h, config/vax/vax.h * config/vax/elf.h: Don't define or use INIT_TARGET_OPTABS, INIT_SUBTARGET_OPTABS, or any *_LIBCALL macros. * config/ia64/hpux.h: Redefine INTEL_EXTENDED_IEEE_FORMAT to 0. Set TARGET_INIT_LIBFUNCS and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/pa/pa-hpux.h: Define LONG_DOUBLE_TYPE_SIZE, HPUX_LONG_DOUBLE_LIBRARY, and FLOAT_LIB_COMPARE_RETURNS_BOOL here. * config/ia64/hpux_longdouble.h, config/pa/long_double.h: Delete. * config/rs6000/xcoff.h: Don't define RS6000_ITRUNC nor RS6000_UITRUNC. * config/sparc/sparc.h: Default SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/sol2.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 1. * config/sparc/elf.h: Redefine SUN_CONVERSION_LIBFUNCS and SUN_INTEGER_MULTIPLY_64 to 0. * config/sparc/lite.h, config/sparc/liteelf.h, config/sparc/sp86x-elf.h: Define US_SOFTWARE_GOFAST. * config/vax/vax.h: Default TARGET_ELF to 0. * config/vax/elf.h: Redefine TARGET_ELF to 1. * config/gofast.h: Don't define any macros here. Provide one static function, gofast_maybe_init_libfuncs, which does what INIT_GOFAST_LIBFUNCS used to do but only if US_SOFTWARE_GOFAST is already defined. Do not clear negation libfuncs. Do not mess with HFmode, XFmode, or TFmode libfuncs. * config/avr/avr.c (avr_init_once): #if 0 out; mark FIXME. From-SVN: r72009
2003-10-02 02:44:29 +02:00
#include "target.h"
1991-12-30 04:19:53 +01:00
struct target_optabs default_target_optabs;
struct target_libfuncs default_target_libfuncs;
#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)
/* Contains the optab used for each rtx code. */
optab code_to_optab[NUM_RTX_CODE + 1];
static void prepare_float_lib_cmp (rtx, rtx, enum rtx_code, rtx *,
enum machine_mode *);
static rtx expand_unop_direct (enum machine_mode, optab, rtx, rtx, int);
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
static hashval_t
hash_libfunc (const void *p)
{
const struct libfunc_entry *const e = (const struct libfunc_entry *) p;
return (((int) e->mode1 + (int) e->mode2 * NUM_MACHINE_MODES)
^ e->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
}
/* 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
static int
eq_libfunc (const void *p, const void *q)
{
const struct libfunc_entry *const e1 = (const struct libfunc_entry *) p;
const struct libfunc_entry *const e2 = (const struct libfunc_entry *) q;
return (e1->optab == e2->optab
&& e1->mode1 == e2->mode1
&& e1->mode2 == e2->mode2);
}
/* 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
convert_optab_libfunc (convert_optab optab, enum machine_mode mode1,
enum machine_mode mode2)
{
struct libfunc_entry e;
struct libfunc_entry **slot;
e.optab = (size_t) (optab - &convert_optab_table[0]);
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 = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, NO_INSERT);
if (!slot)
{
if (optab->libcall_gen)
{
optab->libcall_gen (optab, optab->libcall_basename, mode1, mode2);
slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, NO_INSERT);
if (slot)
return (*slot)->libfunc;
else
return NULL;
}
return NULL;
}
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
optab_libfunc (optab optab, enum machine_mode mode)
{
struct libfunc_entry e;
struct libfunc_entry **slot;
e.optab = (size_t) (optab - &optab_table[0]);
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 = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, NO_INSERT);
if (!slot)
{
if (optab->libcall_gen)
{
optab->libcall_gen (optab, optab->libcall_basename,
optab->libcall_suffix, mode);
slot = (struct libfunc_entry **) htab_find_slot (libfunc_hash,
&e, NO_INSERT);
if (slot)
return (*slot)->libfunc;
else
return NULL;
}
return NULL;
}
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 a previous insn sets TARGET and TARGET is one of OP0 or OP1,
don't add the REG_EQUAL note but return 0. Our caller can then try
again, ensuring that TARGET is not one of the operands. */
static int
add_equal_note (rtx insns, rtx target, enum rtx_code code, rtx op0, rtx op1)
1991-12-30 04:19:53 +01:00
{
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
rtx last_insn, insn, set;
1991-12-30 04:19:53 +01:00
rtx note;
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))
;
set = single_set (last_insn);
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;
/* If TARGET is in OP0 or OP1, check if anything in SEQ sets TARGET
besides the last insn. */
if (reg_overlap_mentioned_p (target, op0)
|| (op1 && reg_overlap_mentioned_p (target, op1)))
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
{
insn = PREV_INSN (last_insn);
while (insn != NULL_RTX)
{
if (reg_set_p (target, insn))
return 0;
insn = PREV_INSN (insn);
}
}
1991-12-30 04:19:53 +01:00
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes... 2004-02-07 Paolo Bonzini <bonzini@gnu.org> * alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes, possibly splitting conditionals that tested against '<' and 'o'. * caller-save.c (save_call_clobbered_regs): Likewise. * combine.c (contains_muldiv, find_split_point, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, simplify_logical, expand_compound_operation, make_compound_operation, if_then_else_cond, known_cond, apply_distributive_law, cached_nonzero_bits, cached_num_sign_bit_copies, simplify_shift_const, gen_binary, simplify_comparison, update_table_tick, record_value_for_reg, get_lsat_value_validate): Likewise. * cse.c (mention_regs, find_best_addr, find_comparison_args, fold_rtx, cse_insn, invalidate_memory, cse_basic_block): Likewise. * emit-rtl.c (copy_insn_1): Likewise. * expr.c (force_operand): Likewise. * final.c (final_scan_insn, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond, and_reg_cond, elim_reg_cond): Likewise. * function.c (update_epilogue_consts): Likewise. * genattrtab.c (attr_rtx_1): Likewise. * genopinit.c (gen_insn): Likewise. * integrate.c (subst_constants): Likewise. * jump.c (reversed_comparison_code_parts, reversed_comparison_code, delete_related_insns, rtx_renumbered_equal_p): Likewise. * local-alloc.c (block_alloc): Likewise. * loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv, canonicalize_condition): Likewise. * loop-iv.c (simplify_using_conditions, iv_number_of_iterations): Likewise. * optabs.c (add_equal_node, expand_binop): Likewise. * predict.c (estimate_probability): Likewise. * ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise. * recog.c (validate_replace_rtx_1, comparison_operator, offsettable_address_p, constrain_operands): Likewise. * reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (stable_and_no_regs_but_for_p): Likewise. * regrename.c (kill_autoinc_value): Likewise. * reload.c (find_reusable_reload, find_reloads, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (gen_reload, delete_address_reloads_1): Likewise. * rtl.c (copy_rtx): Likewise. * rtl.h (CONSTANT_P, INSN_P): Likewise. * rtlanal.c (commutative_operand_precedence): Likewise. * sched-deps.c (conditions_mutex_p): Likewise. * sched-rgn.c (is_cfg_nonregular): Likewise. * simplify-rtx.c (simplify_gen_binary, simplify_gen_relational, simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_ternary_operation, simplify_rtx): Likewise. * unroll.c (reg_dead_after_loop): Likewise. * config/alpha/alpha.c (alpha_swapped_comparison_operator, print_operand): Likewise. * config/arc/arc.c (proper_comparison_operator): Likewise. * config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode): Likewise. * config/avr/avr.c (_reg_unused_after): Likewise. * config/frv/frv.c (frv_ifcvt_modify_tests, frv_ifcvt_modify_insn, frv_pack_insn): Likewise. * config/i386/i386.c (ix86_comparison_operator, ix86_carry_flag_operator, fcmov_comparison_operator, arith_or_logical_operator, print_operand, ix86_expand_binary_operator, ix86_binary_operator_ok): Likewise. * config/i386/i386.md: Likewise. * config/ia64/ia64.c (not_postinc_memory_operand, ia64_print_operand, update_set_flags, errata_emit_nops): Likewise. * config/ia64/ia64.h (PREFERRED_RELOAD_CLASS, CONSTRAINT_OK_FOR_S): Likewise. * config/ip2k/ip2k.c (mdr_resequence_xy_yx, mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref, ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p, ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator): Likewise. * config/iq2000/iq2000.c (cmp_op, symbolic_expression_p, eqne_comparison_operator, signed_comparison_operator): Likewise. * config/mips/mips.c (cmp_op, symbolic_expression_p): Likewise. * config/mmix/mmix (mmix_foldable_comparison_operator, mmix_comparison_operator): Likewise. * config/pa/pa.c (hppa_legitimize_address): Likewise. * config/rs6000/rs6000.c (stmw_operation, branch_comparison_operator, trap_comparison_operator, ccr_bit): Likewise. * config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise. * config/s390/s390.c (s390_alc_comparison, s390_slb_comparison):L Likewise. * config/sh/sh.c (gen_block_redirect, reg_unused_after): Likewise. * config/sparc/sparc.c (eq_or_neq, normal_comp_operator, noov_compare_op, noov_compare64_op, v9_regcmp_op, emit_hard_tfmode_operation, reg_unused_after) * doc/md.texi, doc/rtl.texi: Likewise. * ra-debug.c: Add 2004 to list of copyright years. * unroll.c: Likewise. * combine.c (simplify_logical): Remove dummy test, (apply_distributive_law): Fix typo in comment. GET_CODE (x) == AND so x is a commutative binary op. * jump.c (delete_related_insns): simplify loop condition, move testing of RTX codes inside the loop. (rtx_renumbered_equal_p): do not use RTX_CODE. * rtl.c (rtx_class): Declare as enum rtx_class. * rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED): Move to RTX_COMM_COMPARE class. (HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE): Move to RTX_CONST_OBJ class. * rtl.h (enum rtx_class): New declaration, (RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK, RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT, RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK, RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT, RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P, ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P, SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P, OBJECT_P): New macros. * config/sparc/sparc.c (noov_compare_op): Remove register from parameter. From-SVN: r78824
2004-03-03 09:35:33 +01:00
if (GET_RTX_CLASS (code) == RTX_UNARY)
note = gen_rtx_fmt_e (code, GET_MODE (target), copy_rtx (op0));
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;
}
/* 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
widen_operand (rtx op, enum machine_mode mode, enum 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)
&& SUBREG_PROMOTED_UNSIGNED_P (op) == unsignedp))
return convert_modes (mode, oldmode, op, unsignedp);
/* If MODE is no wider than a single word, we return a paradoxical
SUBREG. */
if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
return gen_rtx_SUBREG (mode, force_reg (GET_MODE (op), op), 0);
/* 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 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:
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 (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) ? NULL : vashl_optab;
gcc_assert (subtype == optab_scalar);
}
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 (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;
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_optab : reduc_smax_optab;
case REDUC_MIN_EXPR:
return TYPE_UNSIGNED (type) ? reduc_umin_optab : reduc_smin_optab;
case REDUC_PLUS_EXPR:
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
return TYPE_UNSIGNED (type) ? reduc_uplus_optab : reduc_splus_optab;
case VEC_LSHIFT_EXPR:
return vec_shl_optab;
case VEC_RSHIFT_EXPR:
return vec_shr_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
[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_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:
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 (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:
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 (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:
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 (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:
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 (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;
c-tree.texi: Document new tree codes. * doc/c-tree.texi: Document new tree codes. * doc/md.texi: Document new optabs. * tree-pretty-print.c (dump_generic_node): Handle print of new tree codes. * optabs.c (optab_for_tree_code, init_optabs): Handle new optabs. * optabs.h (optab_index): Add new. (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): New optabs. * genopinit.c (vec_extract_even_optab, vec_extract_odd_optab, vec_interleave_high_optab, vec_interleave_low_optab): Initialize new optabs. * expr.c (expand_expr_real_1): Add implementation for new tree codes. * tree-vectorizer.c (new_stmt_vec_info): Initialize new fields. * tree-vectorizer.h (stmt_vec_info): Add new fields for interleaving along with macros for their access. * tree-data-ref.h (first_location_in_loop, data_reference): Update comment. * tree-vect-analyze.c (toplev.h): Include. (vect_determine_vectorization_factor): Fix indentation. (vect_insert_into_interleaving_chain, vect_update_interleaving_chain, vect_equal_offsets): New functions. (vect_analyze_data_ref_dependence): Add argument for interleaving check. Check for interleaving if it's true. (vect_check_dependences): New function. (vect_analyze_data_ref_dependences): Call vect_check_dependences for every ddr. Call vect_analyze_data_ref_dependence with new argument. (vect_update_misalignment_for_peel): Update for interleaving. (vect_verify_datarefs_alignment): Check only first data-ref for interleaving. (vect_enhance_data_refs_alignment): Update for interleaving. Check only first data-ref for interleaving. (vect_analyze_data_ref_access): Check interleaving, update interleaving data. (vect_analyze_data_refs): Call compute_data_dependences_for_loop with different parameters. * tree.def (VEC_EXTRACT_EVEN_EXPR, VEC_EXTRACT_ODD_EXPR, VEC_INTERLEAVE_HIGH_EXPR, VEC_INTERLEAVE_LOW_EXPR): New tree codes. * tree-inline.c (estimate_num_insns_1): Add cases for new codes. * tree-vect-transform.c (vect_create_addr_base_for_vector_ref): Update step in case of interleaving. (vect_strided_store_supported, vect_permute_store_chain): New functions. (vectorizable_store): Handle strided stores. (vect_strided_load_supported, vect_permute_load_chain, vect_transform_strided_load): New functions. (vectorizable_load): Handle strided loads. (vect_transform_stmt): Add argument. Handle strided stores. Check that vectorized stmt exists for patterns. (vect_gen_niters_for_prolog_loop): Update calculation for interleaving. (vect_transform_loop): Remove stmt_vec_info for strided stores after whole chain vectorization. * config/rs6000/altivec.md (UNSPEC_EXTEVEN, UNSPEC_EXTODD, UNSPEC_INTERHI, UNSPEC_INTERLO): New constants. (vpkuhum_nomode, vpkuwum_nomode, vec_extract_even<mode>, vec_extract_odd<mode>, altivec_vmrghsf, altivec_vmrglsf, vec_interleave_high<mode>, vec_interleave_low<mode>): Implement. From-SVN: r119088
2006-11-22 09:46:03 +01:00
case VEC_EXTRACT_EVEN_EXPR:
return vec_extract_even_optab;
case VEC_EXTRACT_ODD_EXPR:
return vec_extract_odd_optab;
case VEC_INTERLEAVE_HIGH_EXPR:
return vec_interleave_high_optab;
case VEC_INTERLEAVE_LOW_EXPR:
return vec_interleave_low_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:
return NULL;
}
}
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
{
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;
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum 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;
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
int icode;
collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. ./: * collect2.c (is_ctor_dtor): Change type of ret field in struct names to symkind. * dce.c (run_fast_df_dce): Change type of old_flags to int. * df-core.c (df_set_flags): Change return type to int. Change type of old_flags to int. (df_clear_flags): Likewise. * df-scan.c (df_def_record_1): Change 0 to VOIDmode. (df_get_conditional_uses): Likewise. * df.h (df_set_flags, df_clear_flags): Update declarations. * dwarf2out.c (struct indirect_string_node): Change type of form field to enum dwarf_form. (AT_string_form): Change return type to enum dwarf_form. * fixed-value.c (fixed_compare): Add cast to enum type. * fwprop.c (update_df): Change 0 to VOIDmode. * gensupport.c: Change 0 to UNKNOWN. * gimple.h (gimple_cond_code): Add cast to enum type. * haifa-sched.c (reemit_notes): Add cast to enum type. * hooks.c (hook_int_void_no_regs): Remove function. * hooks.h (hook_int_void_no_regs): Remove declaration. * optabs.c (expand_widen_pattern_expr): Change 0 to VOIDmode. * predict.c (combine_predictions_for_insn): Add casts to enum type. * real.c (real_arithmetic): Add cast to enum type. (real_compare): Likewise. * target.h (struct gcc_target): Change return type of branch_target_register_class to enum reg_class. * target-def.h (TARGET_BRANCH_TARGET_REGISTER_CLASS): Define as default_branch_target_register_class. * targhooks.c (default_branch_target_register_class): New function. * targhooks.h (default_branch_target_register_class): Declare. * tree-data-ref.c (print_direction_vector): Add cast to enum type. * tree-vect-data-refs.c (vect_supportable_dr_alignment): Remove cast to int. * tree-vect-loop.c (vect_create_epilog_for_reduction): Change 0 to ERROR_MARK. * tree-vect-slp.c (vect_build_slp_tree): Change 0 to vect_uninitialized_def. Change 0 to ERROR_MARK. * tree-vect-stmts.c (supportable_widening_operation): Don't initialize icode1 and icode2. * tree-vectorizer.h (enum vect_def_type): Add vect_uninitialized_def. * config/sol2-c.c (cmn_err_length_specs): Change 0 to FMT_LEN_none and to STD_C89. (cmn_err_flag_specs): Change 0 to STD_C89. (cmn_err_char_table): Likewise. * config/arm/arm.c (get_arm_condition_code): Change type of code to enum arm_cond_code. (IWMMXT_BUILTIN): Change 0 to UNKNOWN. (IWMMXT_BUILTIN2): Likewise. (neon_builtin_type_bits): Don't define typedef. (neon_builtin_datum): Change type of bits field to int. (arm_expand_neon_args): Add cast to enum type. * config/ia64/ia64.c (tls_symbolic_operand_type): Change 0 to TLS_MODEL_NONE. * config/i386/i386.c (bdesc_multi_arg): Change 0 to UNKNOWN. Add casts to enum type. * config/mips/mips.c (LOONGSON_BUILTIN_ALIAS): Change 0 to MIPS_FP_COND_f. * config/mips/mips.md (jal_macro): Return enum constant. (single_insn): Likewise. * config/rs6000/rs6000.c (bdesc_altivec_preds): Change 0 to CODE_FOR_nothing. * config/rs6000/rs6000-c.c (altivec_overloaded_builtins): Add casts to enum type. * config/s390/s390.c (s390_tune_flags): Change type to int. (s390_arch_flags): Likewise. (s390_handle_arch_option): Change flags field of struct pta to int. * config/s390/s390.h (s390_tune_flags): Update declaration. (s390_arch_flags): Likewise. * config/sh/sh.c (prepare_move_operands): Compare tls_symbolic_operand result with enum constant. (sh_reorg): Change PUT_MODE to PUT_REG_NOTE_KIND. (sh_expand_prologue): Add cast to enum type. (sh_expand_epilogue): Likewise. (tls_symbolic_operand): Change return type to enum tls_model. (fpscr_set_from_mem): Add cast to enum type. (legitimize_pic_address): Compare tls_symbolic_operand result with enum constant. (sh_target_reg_class): Change return type to enum reg_class. * config/sh/sh.h (OVERRIDE_OPTIONS): Change CPU_xxx to PROCESSOR_xxx. * config/sh/sh-protos.h (tls_symbolic_operand): Update declaration. * config/sparc/sparc.c (sparc_override_options): Add cast to enum type. * config/sparc/sparc.md (empty_delay_slot): Return enum constant. (pic, calls_alloca, calls_eh_return, leaf_function): Likewise. (delayed_branch, tls_call_delay): Likewise. (eligible_for_sibcall_delay): Likewise. (eligible_for_return_delay): Likewise. * config/spu/spu.c (expand_builtin_args): Add cast to enum type. (spu_expand_builtin_1): Likewise. * c-typeck.c (convert_for_assignment): Issue -Wc++-compat warnings for all types of conversions. (output_init_element): Issue -Wc++-compat warning if needed when initializing a bitfield with enum type. * c-parser.c (c_parser_expression): Set original_type to original_type of right hand operand of comman operator. cp/: * semantics.c (finish_omp_clauses): Change type of c_kind to enum omp_clause_code. fortran/: * trans-intrinsic.c (DEFINE_MATH_BUILTIN): Add casts to enum type. * trans-io.c (st_parameter_field): Add casts to enum type. java/: * builtins.c (java_builtins): Add casts to enum type. * verify-impl.c (check_class_constant): Add cast to enum type. (check_constant, check_wide_constant): Likewise. objc/: * objc-act.c (objc_gimplify_expr): Add casts to enum type. testsuite/: * gcc.dg/Wcxx-compat-5.c: New testcase. * gcc.dg/Wcxx-compat-6.c: New testcase. From-SVN: r146855
2009-04-27 22:25:48 +02:00
enum machine_mode xmode0, xmode1 = VOIDmode, wxmode = 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
rtx temp;
rtx pat;
rtx xop0, xop1, wxop;
int nops = TREE_CODE_LENGTH (ops->code);
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 = (int) optab_handler (widen_pattern_optab,
TYPE_MODE (TREE_TYPE (ops->op2)));
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
icode = (int) 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);
xmode0 = insn_data[icode].operand[1].mode;
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));
xmode1 = insn_data[icode].operand[2].mode;
}
/* The last operand is of a wider mode than the rest of the operands. */
if (nops == 2)
{
wmode = tmode1;
wxmode = xmode1;
}
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));
wxmode = insn_data[icode].operand[3].mode;
}
if (!wide_op)
wmode = wxmode = insn_data[icode].operand[0].mode;
if (!target
|| ! (*insn_data[icode].operand[0].predicate) (target, wmode))
temp = gen_reg_rtx (wmode);
else
temp = target;
xop0 = op0;
xop1 = op1;
wxop = wide_op;
/* 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. */
if (GET_MODE (op0) != xmode0 && xmode0 != VOIDmode)
xop0 = convert_modes (xmode0,
GET_MODE (op0) != VOIDmode
? GET_MODE (op0)
: tmode0,
xop0, unsignedp);
if (op1)
if (GET_MODE (op1) != xmode1 && xmode1 != VOIDmode)
xop1 = convert_modes (xmode1,
GET_MODE (op1) != VOIDmode
? GET_MODE (op1)
: tmode1,
xop1, unsignedp);
if (wide_op)
if (GET_MODE (wide_op) != wxmode && wxmode != VOIDmode)
wxop = convert_modes (wxmode,
GET_MODE (wide_op) != VOIDmode
? GET_MODE (wide_op)
: wmode,
wxop, unsignedp);
/* Now, if insn's predicates don't allow our operands, put them into
pseudo regs. */
if (! (*insn_data[icode].operand[1].predicate) (xop0, xmode0)
&& xmode0 != VOIDmode)
xop0 = copy_to_mode_reg (xmode0, xop0);
if (op1)
{
if (! (*insn_data[icode].operand[2].predicate) (xop1, xmode1)
&& xmode1 != VOIDmode)
xop1 = copy_to_mode_reg (xmode1, xop1);
if (wide_op)
{
if (! (*insn_data[icode].operand[3].predicate) (wxop, wxmode)
&& wxmode != VOIDmode)
wxop = copy_to_mode_reg (wxmode, wxop);
pat = GEN_FCN (icode) (temp, xop0, xop1, wxop);
}
else
pat = GEN_FCN (icode) (temp, xop0, xop1);
}
else
{
if (wide_op)
{
if (! (*insn_data[icode].operand[2].predicate) (wxop, wxmode)
&& wxmode != VOIDmode)
wxop = copy_to_mode_reg (wxmode, wxop);
pat = GEN_FCN (icode) (temp, xop0, wxop);
}
else
pat = GEN_FCN (icode) (temp, xop0);
}
emit_insn (pat);
return temp;
}
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
expand_ternary_op (enum 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
{
int icode = (int) 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
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
enum machine_mode mode2 = insn_data[icode].operand[3].mode;
rtx temp;
rtx pat;
rtx xop0 = op0, xop1 = op1, xop2 = op2;
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
if (!target || !insn_data[icode].operand[0].predicate (target, 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
temp = gen_reg_rtx (mode);
else
temp = target;
/* 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. */
if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
xop0 = convert_modes (mode0,
GET_MODE (op0) != VOIDmode
? GET_MODE (op0)
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
: mode,
xop0, unsignedp);
if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
xop1 = convert_modes (mode1,
GET_MODE (op1) != VOIDmode
? GET_MODE (op1)
: mode,
xop1, unsignedp);
if (GET_MODE (op2) != mode2 && mode2 != VOIDmode)
xop2 = convert_modes (mode2,
GET_MODE (op2) != VOIDmode
? GET_MODE (op2)
: mode,
xop2, unsignedp);
/* Now, if insn's predicates don't allow our operands, put them into
pseudo regs. */
if (!insn_data[icode].operand[1].predicate (xop0, mode0)
&& mode0 != VOIDmode)
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
xop0 = copy_to_mode_reg (mode0, xop0);
if (!insn_data[icode].operand[2].predicate (xop1, mode1)
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
&& mode1 != VOIDmode)
xop1 = copy_to_mode_reg (mode1, xop1);
if (!insn_data[icode].operand[3].predicate (xop2, mode2)
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
&& mode2 != VOIDmode)
xop2 = copy_to_mode_reg (mode2, xop2);
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
pat = GEN_FCN (icode) (temp, xop0, xop1, xop2);
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
emit_insn (pat);
return temp;
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. */
static rtx
simplify_expand_binop (enum 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 (binoptab->code, 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
force_expand_binop (enum 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;
}
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
/* Generate insns for VEC_LSHIFT_EXPR, VEC_RSHIFT_EXPR. */
rtx
expand_vec_shift_expr (sepops ops, rtx target)
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
{
enum insn_code icode;
rtx rtx_op1, rtx_op2;
enum machine_mode mode1;
enum machine_mode mode2;
enum machine_mode mode = TYPE_MODE (ops->type);
tree vec_oprnd = ops->op0;
tree shift_oprnd = ops->op1;
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
optab shift_optab;
rtx pat;
switch (ops->code)
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
{
case VEC_RSHIFT_EXPR:
shift_optab = vec_shr_optab;
break;
case VEC_LSHIFT_EXPR:
shift_optab = vec_shl_optab;
break;
default:
gcc_unreachable ();
}
icode = optab_handler (shift_optab, mode);
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
gcc_assert (icode != CODE_FOR_nothing);
mode1 = insn_data[icode].operand[1].mode;
mode2 = insn_data[icode].operand[2].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_op1 = expand_normal (vec_oprnd);
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
if (!(*insn_data[icode].operand[1].predicate) (rtx_op1, mode1)
&& mode1 != VOIDmode)
rtx_op1 = force_reg (mode1, rtx_op1);
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_op2 = expand_normal (shift_oprnd);
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
if (!(*insn_data[icode].operand[2].predicate) (rtx_op2, mode2)
&& mode2 != VOIDmode)
rtx_op2 = force_reg (mode2, rtx_op2);
if (!target
|| ! (*insn_data[icode].operand[0].predicate) (target, mode))
target = gen_reg_rtx (mode);
/* Emit instruction */
pat = GEN_FCN (icode) (target, rtx_op1, rtx_op2);
gcc_assert (pat);
emit_insn (pat);
return target;
}
/* 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
expand_subword_shift (enum 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;
tmp = immed_double_const (BITS_PER_WORD, 0, 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)
{
tmp = immed_double_const (-1, -1, op1_mode);
tmp = simplify_expand_binop (op1_mode, xor_optab, op1, tmp,
0, true, methods);
}
else
{
tmp = immed_double_const (BITS_PER_WORD - 1, 0, 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;
}
#ifdef HAVE_conditional_move
/* 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
expand_doubleword_shift_condmove (enum 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;
}
#endif
/* 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
expand_doubleword_shift (enum 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;
rtx subword_label, done_label;
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. */
tmp = immed_double_const (BITS_PER_WORD, 0, 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);
}
#ifdef HAVE_conditional_move
/* Try using conditional moves to generate straight-line code. */
{
rtx 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);
}
#endif
/* As a last resort, use branches to select the correct alternative. */
subword_label = gen_label_rtx ();
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 (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
expand_doubleword_mult (enum 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
expand_simple_binop (enum machine_mode mode, enum rtx_code code, rtx op0,
rtx op1, rtx target, int unsignedp,
enum optab_methods methods)
{
optab binop = code_to_optab[(int) 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 (binoptab->code)
{
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 (binoptab->code) == RTX_COMM_ARITH
|| binoptab == smul_widen_optab
|| binoptab == umul_widen_optab
|| binoptab == smul_highpart_optab
|| binoptab == umul_highpart_optab);
}
/* X is to be used in mode MODE as an operand 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
avoid_expensive_constant (enum machine_mode mode, optab binoptab,
rtx x, bool unsignedp)
{
bool speed = optimize_insn_for_speed_p ();
if (mode != VOIDmode
&& optimize
&& CONSTANT_P (x)
&& rtx_cost (x, binoptab->code, speed) > rtx_cost (x, SET, 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
expand_binop_directly (enum machine_mode mode, optab binoptab,
rtx op0, rtx op1,
rtx target, int unsignedp, enum optab_methods methods,
rtx last)
{
int icode = (int) optab_handler (binoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
enum machine_mode tmp_mode;
bool commutative_p;
rtx pat;
rtx xop0 = op0, xop1 = op1;
rtx temp;
rtx swap;
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 (target)
temp = target;
else
temp = gen_reg_rtx (mode);
/* 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) != mode0 && GET_MODE (xop1) != mode1
&& GET_MODE (xop0) == mode1 && GET_MODE (xop1) == mode1)
{
swap = xop0;
xop0 = xop1;
xop1 = swap;
}
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. */
xop0 = avoid_expensive_constant (mode0, binoptab, xop0, unsignedp);
if (!shift_optab_p (binoptab))
xop1 = avoid_expensive_constant (mode1, binoptab, 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. */
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 (GET_MODE (xop0) != mode0 && mode0 != VOIDmode)
xop0 = convert_modes (mode0,
GET_MODE (xop0) != VOIDmode
? GET_MODE (xop0)
: mode,
xop0, 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
if (GET_MODE (xop1) != mode1 && mode1 != VOIDmode)
xop1 = convert_modes (mode1,
GET_MODE (xop1) != VOIDmode
? GET_MODE (xop1)
: mode,
xop1, 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
/* 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))
{
swap = xop1;
xop1 = xop0;
xop0 = swap;
}
/* 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 (!insn_data[icode].operand[1].predicate (xop0, mode0)
&& mode0 != VOIDmode)
xop0 = copy_to_mode_reg (mode0, xop0);
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 (!insn_data[icode].operand[2].predicate (xop1, mode1)
&& mode1 != VOIDmode)
xop1 = copy_to_mode_reg (mode1, 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 (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. */
tmp_mode = insn_data[icode].operand[0].mode;
if (GET_MODE_NUNITS (tmp_mode) != 2 * GET_MODE_NUNITS (mode))
return 0;
}
else
tmp_mode = mode;
if (!insn_data[icode].operand[0].predicate (temp, tmp_mode))
temp = gen_reg_rtx (tmp_mode);
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
pat = GEN_FCN (icode) (temp, xop0, xop1);
if (pat)
{
/* 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. */
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
&& ! add_equal_note (pat, temp, binoptab->code, xop0, xop1))
{
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 temp;
}
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
expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
rtx target, int unsignedp, enum optab_methods methods)
1991-12-30 04:19:53 +01:00
{
enum optab_methods next_methods
= (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN
? OPTAB_WIDEN : methods);
enum mode_class mclass;
1991-12-30 04:19:53 +01:00
enum 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;
rtx entry_last = get_last_insn ();
1991-12-30 04:19:53 +01:00
rtx last;
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
&& optab_handler (binoptab, mode) != 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_BITSIZE (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 (bits), 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_WIDER_MODE (mode) != VOIDmode
&& (optab_handler ((unsignedp ? umul_widen_optab : smul_widen_optab),
GET_MODE_WIDER_MODE (mode))
!= CODE_FOR_nothing))
{
temp = expand_binop (GET_MODE_WIDER_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 (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (GET_MODE (temp))))
return gen_lowpart (mode, temp);
else
return convert_to_mode (mode, temp, unsignedp);
}
}
/* 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
&& (optab_handler ((unsignedp ? umul_widen_optab
: smul_widen_optab),
GET_MODE_WIDER_MODE (wider_mode))
!= 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;
xop0 = avoid_expensive_constant (mode, binoptab,
xop0, unsignedp);
if (binoptab != ashl_optab)
xop1 = avoid_expensive_constant (mode, binoptab,
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 (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (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))
{
temp = op1;
op1 = op0;
op0 = temp;
}
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;
1991-12-30 04:19:53 +01:00
rtx insns;
/* If TARGET is the same as one of the operands, the REG_EQUAL note
won't be accurate, so use a new target. */
if (target == 0 || target == op0 || target == op1)
target = gen_reg_rtx (mode);
start_sequence ();
/* Do the actual arithmetic. */
for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
{
rtx target_piece = operand_subword (target, i, 1, mode);
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
&& 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;
enum 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))
{
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
rtx 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)
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_SIZE (mode) == 2 * UNITS_PER_WORD
&& optab_handler (ashl_optab, word_mode) != CODE_FOR_nothing
&& optab_handler (lshr_optab, word_mode) != CODE_FOR_nothing)
{
rtx 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))
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);
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (target == 0 || !REG_P (target))
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 temp = emit_move_insn (target, xtarget);
set_unique_reg_note (temp,
REG_EQUAL,
gen_rtx_fmt_ee (binoptab->code, mode,
copy_rtx (xop0),
copy_rtx (xop1)));
}
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;
1991-12-30 04:19:53 +01:00
if (optab_handler (umul_widen_optab, 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
&& optab_handler (smul_widen_optab, 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_unique_reg_note (temp,
REG_EQUAL,
gen_rtx_fmt_ee (MULT, mode,
copy_rtx (op0),
copy_rtx (op1)));
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))
{
rtx insns;
rtx op1x = op1;
enum 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 (insns, target, value,
gen_rtx_fmt_ee (binoptab->code, mode, op0, op1));
1991-12-30 04:19:53 +01:00
return target;
}
delete_insns_since (last);
/* It can't be done in this mode. Can we do it in a wider mode? */
if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN
|| methods == OPTAB_MUST_WIDEN))
{
/* 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 (optab_handler (binoptab, wider_mode) != 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 (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (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
sign_expand_binop (enum machine_mode mode, optab uoptab, optab soptab,
rtx op0, rtx op1, rtx target, int unsignedp,
enum optab_methods methods)
1991-12-30 04:19:53 +01:00
{
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;
alias.c (struct alias_set_entry_d): Rename from struct alias_set_entry. gcc/ChangeLog: * alias.c (struct alias_set_entry_d): Rename from struct alias_set_entry. Change all uses. * except.c (struct call_site_record_d): Rename from struct call_site_record. Change all uses. * except.h (struct eh_region_d): Rename from struct eh_region. Change all uses. * gcse.c (struct hash_table_d): Rename from struct hash_table. Change all uses. * graphite.c (struct ivtype_map_elt_d): Rename fromstruct ivtype_map_elt. Change all uses. (struct rename_map_elt_d): Rename fromstruct rename_map_elt. Change all uses. (struct ifsese_d): Rename fromstruct ifsese. Change all uses. * graphite.h (struct name_tree_d): Rename from struct name_tree. Change all uses. (struct sese_d): Rename from struct sese. Change all uses. * omega.h (struct eqn_d): Rename from struct eqn. Change all uses. (struct omega_pb_d): Rename from struct omega_pb. Change all uses. * optabs.h (struct optab_d): Rename from struct optab. Change all uses. (struct convert_optab_d): Rename from struct convert_optab. Change all uses. * tree-pass.h (struct ipa_opt_pass_d): Rename fromstruct ipa_opt_pass. Change all uses. * tree-predcom.c (struct dref_d): Rename from struct dref. Change all uses. * c-decl.c (pushtag): If -Wc++-compat, warn if the tag is already defined as a typedef. (grokdeclarator): If -Wc++-compat, warn if a typedef is already defined as a tag. gcc/cp/ChangeLog: * cp-tree.h (enum cp_lvalue_kind_flags): Rename from cp_lvalue_kind. Change all uses. (enum base_access_flags): Rename from enum base_access. Change all uses. * parser.c (enum cp_parser_flags): Remove enum tag. gcc/testsuite/ChangeLog: * gcc.dg/Wcxx-compat-10.c: New testcase. libcpp/ChangeLog: * include/cpplib.h (enum cpp_builtin_type): Rename from enum builtin_type. Change all uses. From-SVN: r147605
2009-05-16 08:54:11 +02:00
struct optab_d wide_soptab;
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. Make a fake signed optab that
hides any signed insn for direct use. */
wide_soptab = *soptab;
set_optab_handler (&wide_soptab, mode, CODE_FOR_nothing);
/* We don't want to generate new hash table entries from this fake
optab. */
wide_soptab.libcall_gen = NULL;
1991-12-30 04:19:53 +01:00
temp = expand_binop (mode, &wide_soptab, op0, op1, target,
unsignedp, OPTAB_WIDEN);
/* For unsigned operands, try widening to an unsigned int. */
if (temp == 0 && unsignedp)
temp = expand_binop (mode, uoptab, op0, op1, target,
unsignedp, OPTAB_WIDEN);
if (temp || methods == OPTAB_WIDEN)
return temp;
/* Use the right width libcall if that exists. */
1991-12-30 04:19:53 +01:00
temp = expand_binop (mode, direct_optab, op0, op1, target, unsignedp, OPTAB_LIB);
if (temp || methods == OPTAB_LIB)
return temp;
/* Must widen and use a libcall, use either signed or unsigned. */
1991-12-30 04:19:53 +01:00
temp = expand_binop (mode, &wide_soptab, op0, op1, target,
unsignedp, methods);
if (temp != 0)
return temp;
if (unsignedp)
return expand_binop (mode, uoptab, op0, op1, target,
unsignedp, methods);
return 0;
}
/* 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)
{
enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
enum mode_class mclass;
enum machine_mode wider_mode;
rtx entry_last = get_last_insn ();
rtx 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)
{
int icode = (int) optab_handler (unoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[2].mode;
rtx pat;
rtx xop0 = op0;
if (GET_MODE (xop0) != VOIDmode
&& GET_MODE (xop0) != mode0)
xop0 = convert_to_mode (mode0, xop0, unsignedp);
/* Now, if insn doesn't accept these operands, put them into pseudos. */
if (!insn_data[icode].operand[2].predicate (xop0, mode0))
xop0 = copy_to_mode_reg (mode0, xop0);
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
gcc_assert (insn_data[icode].operand[1].predicate (targ1, mode));
pat = GEN_FCN (icode) (targ0, targ1, xop0);
if (pat)
{
emit_insn (pat);
return 1;
}
else
delete_insns_since (last);
}
/* It can't be done in this mode. Can we do it in a wider mode? */
if (CLASS_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
{
enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
enum mode_class mclass;
1991-12-30 04:19:53 +01:00
enum machine_mode wider_mode;
rtx entry_last = get_last_insn ();
1991-12-30 04:19:53 +01:00
rtx last;
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
{
int icode = (int) optab_handler (binoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
enum machine_mode mode1 = insn_data[icode].operand[2].mode;
1991-12-30 04:19:53 +01:00
rtx pat;
rtx xop0 = op0, xop1 = op1;
/* If we are optimizing, force expensive constants into a register. */
xop0 = avoid_expensive_constant (mode0, binoptab, xop0, unsignedp);
xop1 = avoid_expensive_constant (mode1, binoptab, 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. */
1991-12-30 04:19:53 +01:00
if (GET_MODE (op0) != mode0 && mode0 != VOIDmode)
xop0 = convert_modes (mode0,
GET_MODE (op0) != VOIDmode
? GET_MODE (op0)
: mode,
xop0, unsignedp);
if (GET_MODE (op1) != mode1 && mode1 != VOIDmode)
xop1 = convert_modes (mode1,
GET_MODE (op1) != VOIDmode
? GET_MODE (op1)
: mode,
xop1, unsignedp);
1991-12-30 04:19:53 +01:00
/* Now, if insn doesn't accept these operands, put them into pseudos. */
if (!insn_data[icode].operand[1].predicate (xop0, mode0))
1991-12-30 04:19:53 +01:00
xop0 = copy_to_mode_reg (mode0, xop0);
if (!insn_data[icode].operand[2].predicate (xop1, mode1))
1991-12-30 04:19:53 +01:00
xop1 = copy_to_mode_reg (mode1, xop1);
/* We could handle this, but we should always be called with a pseudo
for our targets and all insns should take them as outputs. */
gcc_assert (insn_data[icode].operand[0].predicate (targ0, mode));
gcc_assert (insn_data[icode].operand[3].predicate (targ1, mode));
1991-12-30 04:19:53 +01:00
pat = GEN_FCN (icode) (targ0, xop0, xop1, targ1);
if (pat)
{
emit_insn (pat);
return 1;
}
else
delete_insns_since (last);
}
/* It can't be done in this mode. Can we do it in a wider mode? */
if (CLASS_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)
{
enum machine_mode mode;
enum machine_mode libval_mode;
rtx libval;
rtx 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
expand_simple_unop (enum machine_mode mode, enum rtx_code code, rtx op0,
rtx target, int unsignedp)
{
optab unop = code_to_optab[(int) 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
(clz:wide (zero_extend:wide x)) - ((width wide) - (width narrow)). */
static rtx
widen_clz (enum machine_mode mode, rtx op0, rtx target)
[multiple changes] 2003-02-01 Richard Henderson <rth@redhat.com> * optabs.c (expand_unop): Use word_mode for outmode of bit scaners. * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change return type to Wtype. * libgcc-std.ver (GCC_3.4): Fix inheritance. * config/i386/i386.md (ffssi2): Use nonimmediate_operand for expander input constraint. 2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and OTI_parity. (clz_optab, ctz_optab, popcount_optab, parity_optab): New. * optabs.c (widen_clz, expand_parity): New. (expand_unop): Handle clz and parity. Hardcode SImode as outmode for libcalls to clz, ctz, popcount, and parity. (init_optabs): Init clz_optab, ctz_optab, popcount_optab and parity_optab, and set up libfunc handlers. * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2, __popcount_tab): New. * libgcc2.h: Declare them. * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c. * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab and parity_optab. * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New. * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT, BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL, BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL, BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL, BUILT_IN_PARITYLL): New. * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs and add optab argument. (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*. * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New. * expr.c (expand_expr): Handle them. * fold-const.c (tree_expr_nonnegative_p): Likewise. * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New. * reload1.c (eliminate_regs): Handle them. (elimination_effects): Likewise. * function.c (instantiate_virtual_regs_1): Likewise * genattrtab.c (check_attr_value): Likewise. * simplify-rtx.c (simplify_unary_operation): Likewise. * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR. * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY. (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY. * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New. * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to __builtin_arm_clz. * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move... * mklibgcc.in (lib2funcs): ...here and merge. Add new members. * doc/extend.texi (Other Builtins): Add new builtins. * doc/md.texi (Standard Names): Add new patterns. From-SVN: r62252
2003-02-01 20:00:02 +01:00
{
enum mode_class 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
{
enum 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))
{
if (optab_handler (clz_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
{
rtx xop0, temp, last;
last = get_last_insn ();
if (target == 0)
target = gen_reg_rtx (mode);
xop0 = widen_operand (op0, wider_mode, mode, true, false);
temp = expand_unop (wider_mode, clz_optab, xop0, NULL_RTX, true);
if (temp != 0)
temp = expand_binop (wider_mode, sub_optab, temp,
GEN_INT (GET_MODE_BITSIZE (wider_mode)
- GET_MODE_BITSIZE (mode)),
target, true, OPTAB_DIRECT);
if (temp == 0)
delete_insns_since (last);
return temp;
}
}
}
return 0;
}
/* Try calculating 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
expand_doubleword_clz (enum 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);
rtx hi0_label = gen_label_rtx ();
rtx after_label = gen_label_rtx ();
rtx seq, 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 (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 (GET_MODE_BITSIZE (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
widen_bswap (enum machine_mode mode, rtx op0, rtx target)
{
enum mode_class mclass = GET_MODE_CLASS (mode);
enum machine_mode wider_mode;
rtx x, 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);
if (x != 0)
x = expand_shift (RSHIFT_EXPR, wider_mode, x,
size_int (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
expand_doubleword_bswap (enum 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)
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
expand_parity (enum machine_mode mode, rtx op0, rtx target)
[multiple changes] 2003-02-01 Richard Henderson <rth@redhat.com> * optabs.c (expand_unop): Use word_mode for outmode of bit scaners. * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change return type to Wtype. * libgcc-std.ver (GCC_3.4): Fix inheritance. * config/i386/i386.md (ffssi2): Use nonimmediate_operand for expander input constraint. 2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and OTI_parity. (clz_optab, ctz_optab, popcount_optab, parity_optab): New. * optabs.c (widen_clz, expand_parity): New. (expand_unop): Handle clz and parity. Hardcode SImode as outmode for libcalls to clz, ctz, popcount, and parity. (init_optabs): Init clz_optab, ctz_optab, popcount_optab and parity_optab, and set up libfunc handlers. * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2, __popcount_tab): New. * libgcc2.h: Declare them. * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c. * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab and parity_optab. * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New. * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT, BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL, BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL, BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL, BUILT_IN_PARITYLL): New. * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs and add optab argument. (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*. * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New. * expr.c (expand_expr): Handle them. * fold-const.c (tree_expr_nonnegative_p): Likewise. * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New. * reload1.c (eliminate_regs): Handle them. (elimination_effects): Likewise. * function.c (instantiate_virtual_regs_1): Likewise * genattrtab.c (check_attr_value): Likewise. * simplify-rtx.c (simplify_unary_operation): Likewise. * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR. * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY. (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY. * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New. * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to __builtin_arm_clz. * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move... * mklibgcc.in (lib2funcs): ...here and merge. Add new members. * doc/extend.texi (Other Builtins): Add new builtins. * doc/md.texi (Standard Names): Add new patterns. From-SVN: r62252
2003-02-01 20:00:02 +01:00
{
enum mode_class 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
{
enum machine_mode wider_mode;
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
{
rtx xop0, temp, last;
last = get_last_insn ();
if (target == 0)
target = gen_reg_rtx (mode);
xop0 = widen_operand (op0, wider_mode, mode, true, false);
temp = expand_unop (wider_mode, popcount_optab, xop0, NULL_RTX,
true);
if (temp != 0)
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_BITSIZE(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
expand_ctz (enum machine_mode mode, rtx op0, rtx target)
{
rtx seq, 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 (GET_MODE_BITSIZE (mode) - 1),
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
expand_ffs (enum machine_mode mode, rtx op0, rtx target)
{
HOST_WIDE_INT val = 0;
bool defined_at_zero = false;
rtx temp, 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_BITSIZE (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.) */
rtx 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 (1),
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
lowpart_subreg_maybe_copy (enum machine_mode omode, rtx val,
enum 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
expand_absneg_bit (enum rtx_code code, enum machine_mode mode,
rtx op0, rtx target)
{
const struct real_format *fmt;
int bitpos, word, nwords, i;
enum machine_mode imode;
double_int mask;
rtx temp, 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;
}
mask = double_int_setbit (double_int_zero, bitpos);
if (code == ABS)
mask = double_int_not (mask);
if (target == 0 || target == op0)
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,
immed_double_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),
immed_double_int_const (mask, imode),
gen_lowpart (imode, target), 1, OPTAB_LIB_WIDEN);
target = lowpart_subreg_maybe_copy (mode, temp, imode);
set_unique_reg_note (get_last_insn (), REG_EQUAL,
gen_rtx_fmt_e (code, mode, copy_rtx (op0)));
}
return target;
}
/* As expand_unop, but will fail rather than attempt the operation in a
different mode or with a libcall. */
static rtx
expand_unop_direct (enum 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
{
int icode = (int) optab_handler (unoptab, mode);
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
1991-12-30 04:19:53 +01:00
rtx xop0 = op0;
rtx last = get_last_insn ();
rtx pat, temp;
1991-12-30 04:19:53 +01:00
if (target)
temp = target;
else
temp = gen_reg_rtx (mode);
if (GET_MODE (xop0) != VOIDmode
&& GET_MODE (xop0) != mode0)
xop0 = convert_to_mode (mode0, xop0, unsignedp);
/* Now, if insn doesn't accept our operand, put it into a pseudo. */
if (!insn_data[icode].operand[1].predicate (xop0, mode0))
1991-12-30 04:19:53 +01:00
xop0 = copy_to_mode_reg (mode0, xop0);
if (!insn_data[icode].operand[0].predicate (temp, mode))
1991-12-30 04:19:53 +01:00
temp = gen_reg_rtx (mode);
pat = GEN_FCN (icode) (temp, xop0);
if (pat)
{
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX
1992-07-06 22:04:10 +02:00
&& ! add_equal_note (pat, temp, unoptab->code, xop0, NULL_RTX))
1991-12-30 04:19:53 +01:00
{
delete_insns_since (last);
1992-07-06 22:04:10 +02:00
return expand_unop (mode, unoptab, op0, NULL_RTX, unsignedp);
1991-12-30 04:19:53 +01:00
}
emit_insn (pat);
1991-12-30 04:19:53 +01:00
return temp;
}
else
delete_insns_since (last);
}
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
expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
int unsignedp)
{
enum mode_class mclass = GET_MODE_CLASS (mode);
enum 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)
{
temp = widen_clz (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_clz (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
goto try_libcall;
}
/* 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)
{
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;
rtx 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 (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (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;
1991-12-30 04:19:53 +01:00
rtx insns;
if (target == 0 || target == op0)
target = gen_reg_rtx (mode);
start_sequence ();
/* Do the actual arithmetic. */
for (i = 0; i < GET_MODE_BITSIZE (mode) / BITS_PER_WORD; i++)
{
rtx target_piece = operand_subword (target, i, 1, mode);
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 (unoptab->code == 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
{
rtx insns;
rtx value;
rtx eq_value;
[multiple changes] 2003-02-01 Richard Henderson <rth@redhat.com> * optabs.c (expand_unop): Use word_mode for outmode of bit scaners. * libgcc2.c (__ffsdi2, __clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2): Change return type to Wtype. * libgcc-std.ver (GCC_3.4): Fix inheritance. * config/i386/i386.md (ffssi2): Use nonimmediate_operand for expander input constraint. 2003-02-01 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de> * optabs.h (optab_index): Add OTI_clz, OTI_ctz, OTI_popcount and OTI_parity. (clz_optab, ctz_optab, popcount_optab, parity_optab): New. * optabs.c (widen_clz, expand_parity): New. (expand_unop): Handle clz and parity. Hardcode SImode as outmode for libcalls to clz, ctz, popcount, and parity. (init_optabs): Init clz_optab, ctz_optab, popcount_optab and parity_optab, and set up libfunc handlers. * libgcc2.c (__clzsi2, __clzdi2, __ctzsi2, __ctzdi2, __popcountsi2, __popcountdi2, __paritysi2 __paritydi2, __popcount_tab): New. * libgcc2.h: Declare them. * libgcc-std.ver (GCC_3.4): Add new functions from libgcc2.c. * genopinit.c (optabs): Add clz_optab, ctz_optab, popcount_optab and parity_optab. * builtin-types.def (BT_FN_INT_LONG, BT_FN_INT_LONGLONG): New. * builtins.def (BUILT_IN_CLZ, BUILT_IN_CTZ, BUILT_IN_POPCOUNT, BUILT_IN_PARITY, BUILT_IN_FFSL, BUILT_IN_CLZL, BUILT_IN_CTZL, BUILT_IN_POPCOUNTL, BUILT_IN_PARITYL, BUILT_IN_FFSLL, BUILT_IN_CLZLL, BUILT_IN_CTZLL, BUILT_IN_POPCOUNTLL, BUILT_IN_PARITYLL): New. * builtins.c (expand_builtin_unop): Rename from expand_builtin_ffs and add optab argument. (expand_builtin): Expand BUILT_IN_{FFS,CLZ,POPCOUNT,PARITY}*. * tree.def (CLZ_EXPR, CTZ_EXPR, POPCOUNT_EXPR, PARITY_EXPR): New. * expr.c (expand_expr): Handle them. * fold-const.c (tree_expr_nonnegative_p): Likewise. * rtl.def (CLZ, CTZ, POPCOUNT, PARITY): New. * reload1.c (eliminate_regs): Handle them. (elimination_effects): Likewise. * function.c (instantiate_virtual_regs_1): Likewise * genattrtab.c (check_attr_value): Likewise. * simplify-rtx.c (simplify_unary_operation): Likewise. * c-common.c (c_common_truthvalue_conversion): Handle POPCOUNT_EXPR. * combine.c (combine_simplify_rtx): Handle POPCOUNT and PARITY. (nonzero_bits): Handle CLZ, CTZ, POPCOUNT and PARITY. * config/alpha/alpha.md (clzdi2, ctzdi2, popcountdi2): New. * config/arm/arm.c (arm_init_builtins): Rename __builtin_clz to __builtin_arm_clz. * Makefile.in (LIB2FUNCS_1, LIB2FUNCS_2): Move... * mklibgcc.in (lib2funcs): ...here and merge. Add new members. * doc/extend.texi (Other Builtins): Add new builtins. * doc/md.texi (Standard Names): Add new patterns. From-SVN: r62252
2003-02-01 20:00:02 +01:00
enum machine_mode outmode = mode;
/* All of these functions return small values. Thus we choose to
have them return something that isn't a double-word. */
if (unoptab == ffs_optab || unoptab == clz_optab || unoptab == ctz_optab
|| unoptab == popcount_optab || unoptab == parity_optab)
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 (unoptab->code, 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 (insns, target, value, eq_value);
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;
rtx 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 we are generating clz using wider mode, adjust the
result. */
if (unoptab == clz_optab && temp != 0)
temp = expand_binop (wider_mode, sub_optab, temp,
GEN_INT (GET_MODE_BITSIZE (wider_mode)
- GET_MODE_BITSIZE (mode)),
target, true, OPTAB_DIRECT);
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 (unoptab->code == 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
expand_abs_nojump (enum machine_mode mode, rtx op0, rtx target,
int result_unsignedp)
{
rtx temp;
if (! 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
{
rtx last = get_last_insn ();
temp = expand_unop (mode, neg_optab, op0, NULL_RTX, 0);
if (temp != 0)
temp = expand_binop (mode, smax_optab, op0, temp, target, 0,
OPTAB_WIDEN);
if (temp != 0)
return temp;
delete_insns_since (last);
}
/* 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,
size_int (GET_MODE_BITSIZE (mode) - 1),
NULL_RTX, 0);
temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
OPTAB_LIB_WIDEN);
if (temp != 0)
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
expand_abs (enum machine_mode mode, rtx op0, rtx target,
int result_unsignedp, int safe)
{
rtx temp, op1;
if (! 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,
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
NULL_RTX, NULL_RTX, 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
expand_one_cmpl_abs_nojump (enum 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)
{
rtx 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,
size_int (GET_MODE_BITSIZE (mode) - 1),
NULL_RTX, 0);
temp = expand_binop (mode, xor_optab, extended, op0, target, 0,
OPTAB_LIB_WIDEN);
if (temp != 0)
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
expand_copysign_absneg (enum machine_mode mode, rtx op0, rtx op1, rtx target,
int bitpos, bool op0_is_abs)
{
enum machine_mode imode;
int icode;
rtx sign, label;
if (target == op1)
target = NULL_RTX;
/* Check if the back end provides an insn that handles signbit for the
argument's mode. */
icode = (int) optab_handler (signbit_optab, mode);
if (icode != CODE_FOR_nothing)
{
imode = insn_data[icode].operand[0].mode;
sign = gen_reg_rtx (imode);
emit_unop_insn (icode, sign, op1, UNKNOWN);
}
else
{
double_int mask;
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);
}
mask = double_int_setbit (double_int_zero, bitpos);
sign = expand_binop (imode, and_optab, op1,
immed_double_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 (GET_CODE (op0) == CONST_DOUBLE)
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
expand_copysign_bit (enum machine_mode mode, rtx op0, rtx op1, rtx target,
int bitpos, bool op0_is_abs)
{
enum machine_mode imode;
double_int mask;
int word, nwords, i;
rtx temp, 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;
}
mask = double_int_setbit (double_int_zero, bitpos);
if (target == 0 || target == op0 || target == op1)
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,
immed_double_int_const (double_int_not (mask),
imode),
NULL_RTX, 1, OPTAB_LIB_WIDEN);
op1 = expand_binop (imode, and_optab,
operand_subword_force (op1, i, mode),
immed_double_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),
immed_double_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,
immed_double_int_const (double_int_not (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)
{
enum 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 (GET_CODE (op0) == CONST_DOUBLE)
{
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
&& (GET_CODE (op0) == CONST_DOUBLE
|| (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
maybe_emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
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;
enum machine_mode mode0 = insn_data[icode].operand[1].mode;
1991-12-30 04:19:53 +01:00
rtx pat;
rtx last = get_last_insn ();
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
temp = target;
1991-12-30 04:19:53 +01:00
/* Now, if insn does not accept our operands, put them into pseudos. */
if (!insn_data[icode].operand[1].predicate (op0, mode0))
1991-12-30 04:19:53 +01:00
op0 = copy_to_mode_reg (mode0, op0);
if (!insn_data[icode].operand[0].predicate (temp, GET_MODE (temp)))
1991-12-30 04:19:53 +01:00
temp = gen_reg_rtx (GET_MODE (temp));
pat = GEN_FCN (icode) (temp, op0);
if (!pat)
{
delete_insns_since (last);
return false;
}
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
if (INSN_P (pat) && NEXT_INSN (pat) != NULL_RTX && code != UNKNOWN)
1992-07-06 22:04:10 +02:00
add_equal_note (pat, temp, code, op0, NULL_RTX);
1991-12-30 04:19:53 +01:00
emit_insn (pat);
if (temp != target)
emit_move_insn (target, temp);
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
emit_unop_insn (int 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
{
rtx target, 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. */
1991-12-30 04:19:53 +01:00
void
emit_libcall_block (rtx insns, rtx target, rtx result, rtx equiv)
1991-12-30 04:19:53 +01:00
{
rtx final_dest = target;
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
rtx 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. */
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 && 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))
NEXT_INSN (PREV_INSN (insn)) = next;
else
insns = next;
1991-12-30 04:19:53 +01:00
if (next)
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);
if (optab_handler (mov_optab, GET_MODE (target)) != CODE_FOR_nothing)
set_unique_reg_note (last, REG_EQUAL, copy_rtx (equiv));
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
}
/* 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
can_compare_p (enum rtx_code code, enum machine_mode mode,
enum can_compare_purpose purpose)
{
rtx test;
test = gen_rtx_fmt_ee (code, mode, const0_rtx, const0_rtx);
do
{
int icode;
if (purpose == ccp_jump
&& (icode = optab_handler (cbranch_optab, mode)) != CODE_FOR_nothing
&& insn_data[icode].operand[0].predicate (test, mode))
return 1;
if (purpose == ccp_store_flag
&& (icode = optab_handler (cstore_optab, mode)) != CODE_FOR_nothing
&& insn_data[icode].operand[1].predicate (test, mode))
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,
rtx *ptest, enum machine_mode *pmode)
1991-12-30 04:19:53 +01:00
{
enum machine_mode mode = *pmode;
rtx libfunc, test;
enum 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
&& (rtx_cost (x, COMPARE, optimize_insn_for_speed_p ())
> COSTS_N_INSNS (1)))
x = force_reg (mode, x);
if (CONSTANT_P (y) && optimize
&& (rtx_cost (y, COMPARE, optimize_insn_for_speed_p ())
> COSTS_N_INSNS (1)))
y = force_reg (mode, y);
#ifdef 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)
{
enum 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);
*ptest = gen_rtx_fmt_ee (comparison, VOIDmode, result, const0_rtx);
*pmode = result_mode;
1991-12-30 04:19:53 +01:00
return;
}
/* 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)
{
gcc_assert (can_compare_p (comparison, CCmode, ccp_jump));
*ptest = gen_rtx_fmt_ee (comparison, VOIDmode, x, 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
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_data[icode].operand[0].predicate (test, VOIDmode))
{
rtx 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_data[icode].operand[1].predicate
(op0, insn_data[icode].operand[1].mode)
&& insn_data[icode].operand[2].predicate
(op1, insn_data[icode].operand[2].mode))
{
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;
/* 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
result = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
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
targetm.libgcc_cmp_return_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. */
x = result;
y = const1_rtx;
if (!TARGET_LIB_INT_CMP_BIASED)
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)
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
x = plus_constant (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 = word_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
prepare_operand (int icode, rtx x, int opnum, enum machine_mode mode,
enum machine_mode wider_mode, int unsignedp)
{
if (mode != wider_mode)
x = convert_modes (wider_mode, mode, x, unsignedp);
if (!insn_data[icode].operand[opnum].predicate
(x, insn_data[icode].operand[opnum].mode))
{
if (reload_completed)
return NULL_RTX;
x = copy_to_mode_reg (insn_data[icode].operand[opnum].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
emit_cmp_and_jump_insn_1 (rtx test, enum machine_mode mode, rtx label)
{
enum machine_mode optab_mode;
enum mode_class mclass;
enum insn_code icode;
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_data[icode].operand[0].predicate (test, VOIDmode));
emit_jump_insn (GEN_FCN (icode) (test, XEXP (test, 0), XEXP (test, 1), label));
}
/* 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
UNSIGNEDP to select a proper jump instruction. */
void
emit_cmp_and_jump_insns (rtx x, rtx y, enum rtx_code comparison, rtx size,
enum machine_mode mode, int unsignedp, rtx label)
{
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);
emit_cmp_and_jump_insn_1 (test, mode, label);
}
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,
rtx *ptest, enum 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);
* 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 machine_mode orig_mode = GET_MODE (x);
enum machine_mode mode, cmp_mode;
rtx true_rtx, false_rtx;
rtx value, target, insns, equiv;
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
{
* libfuncs.h (LTI_eqhf2, LTI_nehf2, LTI_gthf2, LTI_gehf2, LTI_lthf2) (LTI_lehf2, LTI_unordhf2, LTI_eqsf2, LTI_nesf2, LTI_gtsf2) (LTI_gesf2, LTI_ltsf2, LTI_lesf2, LTI_unordsf2, LTI_eqdf2) (LTI_nedf2, LTI_gtdf2, LTI_gedf2, LTI_ltdf2, LTI_ledf2) (LTI_unorddf2, LTI_eqxf2, LTI_nexf2, LTI_gtxf2, LTI_gexf2) (LTI_ltxf2, LTI_lexf2, LTI_unordxf2, LTI_eqtf2, LTI_netf2) (LTI_gttf2, LTI_getf2, LTI_lttf2, LTI_letf2, LTI_unordtf2) (eqhf2_libfunc, nehf2_libfunc, gthf2_libfunc, gehf2_libfunc) (lthf2_libfunc, lehf2_libfunc, unordhf2_libfunc, eqsf2_libfunc) (nesf2_libfunc, gtsf2_libfunc, gesf2_libfunc, ltsf2_libfunc) (lesf2_libfunc, unordsf2_libfunc eqdf2_libfunc, nedf2_libfunc) (gtdf2_libfunc, gedf2_libfunc, ltdf2_libfunc, ledf2_libfunc) (unorddf2_libfunc eqxf2_libfunc, nexf2_libfunc, gtxf2_libfunc) (gexf2_libfunc, ltxf2_libfunc, lexf2_libfunc, unordxf2_libfunc (eqtf2_libfunc, netf2_libfunc, gttf2_libfunc, getf2_libfunc) (lttf2_libfunc, letf2_libfunc, unordtf2_libfunc): Delete. * optabs.h (OTI_eq, OTI_ne, OTI_gt, OTI_ge, OTI_lt, OTI_le) (OTI_unord, eq_optab, ne_optab, gt_optab, ge_optab, lt_optab) (le_optab, unord_optab): New. * optabs.c (prepare_float_lib_cmp): Rewrite. Get the libfuncs from the code_to_optab table, not a giant switch; use swap_condition; do widening only if a comparison function that we can call exists in a wider mode, not if a cmp_optab insn or libfunc exists in a wider mode; call protect_from_queue exactly once on each operand. (init_optabs): Initialize the new optabs, not the deleted libfuncs. * config/gofast.h, config/ia64/ia64.c, config/mips/mips.c * config/pa/pa.c, config/rs6000/rs6000.c, config/sparc/sparc.c: Set floating point comparison libfuncs using set_optab_libfunc on the appropriate optab. * config/ia64/ia64.c (ia64_hpux_init_libfuncs): Fix typo. * config/rs6000/rs6000.c (rs6000_init_libfuncs): Correct ABI selector conditionals. From-SVN: r72101
2003-10-04 23:36:08 +02:00
rtx tmp;
tmp = x; x = y; y = tmp;
comparison = swapped;
break;
1991-12-30 04:19:53 +01:00
}
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)
1991-12-30 04:19:53 +01:00
{
if (!insn_data[(int) CODE_FOR_indirect_jump].operand[0].predicate
(loc, Pmode))
loc = copy_to_mode_reg (Pmode, loc);
1991-12-30 04:19:53 +01:00
emit_jump_insn (gen_indirect_jump (loc));
emit_barrier ();
1991-12-30 04:19:53 +01:00
}
#ifdef HAVE_conditional_move
/* Emit a conditional move instruction if the machine supports one for that
condition and machine mode.
OP0 and OP1 are the operands that should be compared using CODE. CMODE is
the mode to use should they be constants. If it is VOIDmode, they cannot
both be constants.
OP2 should be stored in TARGET if the comparison is true, otherwise OP3
should be stored there. MODE is the mode to use should they be constants.
If it is VOIDmode, they cannot both be constants.
The result is either TARGET (perhaps modified) or NULL_RTX if the operation
is not supported. */
rtx
emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
enum machine_mode cmode, rtx op2, rtx op3,
enum machine_mode mode, int unsignedp)
{
rtx tem, subtarget, comparison, insn;
enum insn_code icode;
enum rtx_code reversed;
/* If one operand is constant, make it the second one. Only do this
if the other operand is not constant as well. */
if (swap_commutative_operands_p (op0, op1))
{
tem = op0;
op0 = op1;
op1 = tem;
code = swap_condition (code);
}
/* get_condition will prefer to generate LT and GT even if the old
comparison was against zero, so undo that canonicalization here since
comparisons against zero are cheaper. */
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))
{
tem = op2;
op2 = op3;
op3 = tem;
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);
subtarget = target;
/* If the insn doesn't accept these operands, put them in pseudos. */
if (!insn_data[icode].operand[0].predicate
(subtarget, insn_data[icode].operand[0].mode))
subtarget = gen_reg_rtx (insn_data[icode].operand[0].mode);
if (!insn_data[icode].operand[2].predicate
(op2, insn_data[icode].operand[2].mode))
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
if (!insn_data[icode].operand[3].predicate
(op3, insn_data[icode].operand[3].mode))
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
/* Everything should now be in the suitable form. */
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 ();
start_sequence ();
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp, OPTAB_WIDEN,
&comparison, &cmode);
if (!comparison)
insn = NULL_RTX;
else
insn = GEN_FCN (icode) (subtarget, comparison, op2, op3);
/* If that failed, then give up. */
if (insn == 0)
{
end_sequence ();
return 0;
}
emit_insn (insn);
insn = get_insns ();
end_sequence ();
emit_insn (insn);
if (subtarget != target)
convert_move (target, subtarget, 0);
return target;
}
/* 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
can_conditionally_move_p (enum 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;
}
#endif /* HAVE_conditional_move */
/* Emit a conditional addition instruction if the machine supports one for that
condition and machine mode.
OP0 and OP1 are the operands that should be compared using CODE. CMODE is
the mode to use should they be constants. If it is VOIDmode, they cannot
both be constants.
OP2 should be stored in TARGET if the comparison is true, otherwise OP2+OP3
should be stored there. MODE is the mode to use should they be constants.
If it is VOIDmode, they cannot both be constants.
The result is either TARGET (perhaps modified) or NULL_RTX if the operation
is not supported. */
rtx
emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
enum machine_mode cmode, rtx op2, rtx op3,
enum machine_mode mode, int unsignedp)
{
rtx tem, subtarget, comparison, insn;
enum insn_code icode;
enum rtx_code reversed;
/* If one operand is constant, make it the second one. Only do this
if the other operand is not constant as well. */
if (swap_commutative_operands_p (op0, op1))
{
tem = op0;
op0 = op1;
op1 = tem;
code = swap_condition (code);
}
/* get_condition will prefer to generate LT and GT even if the old
comparison was against zero, so undo that canonicalization here since
comparisons against zero are cheaper. */
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))
{
tem = op2;
op2 = op3;
op3 = tem;
code = reversed;
}
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);
/* If the insn doesn't accept these operands, put them in pseudos. */
if (!insn_data[icode].operand[0].predicate
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
(target, insn_data[icode].operand[0].mode))
subtarget = gen_reg_rtx (insn_data[icode].operand[0].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
else
subtarget = target;
if (!insn_data[icode].operand[2].predicate
(op2, insn_data[icode].operand[2].mode))
op2 = copy_to_mode_reg (insn_data[icode].operand[2].mode, op2);
if (!insn_data[icode].operand[3].predicate
(op3, insn_data[icode].operand[3].mode))
op3 = copy_to_mode_reg (insn_data[icode].operand[3].mode, op3);
/* Everything should now be in the suitable form. */
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 ();
start_sequence ();
prepare_cmp_insn (XEXP (comparison, 0), XEXP (comparison, 1),
GET_CODE (comparison), NULL_RTX, unsignedp, OPTAB_WIDEN,
&comparison, &cmode);
if (!comparison)
insn = NULL_RTX;
else
insn = GEN_FCN (icode) (subtarget, comparison, op2, op3);
/* If that failed, then give up. */
if (insn == 0)
{
end_sequence ();
return 0;
}
emit_insn (insn);
insn = get_insns ();
end_sequence ();
emit_insn (insn);
if (subtarget != target)
convert_move (target, subtarget, 0);
return target;
}
/* 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
gen_add2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
int icode = (int) optab_handler (add_optab, GET_MODE (x));
1991-12-30 04:19:53 +01:00
gcc_assert (insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode));
gcc_assert (insn_data[icode].operand[1].predicate
(x, insn_data[icode].operand[1].mode));
gcc_assert (insn_data[icode].operand[2].predicate
(y, insn_data[icode].operand[2].mode));
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
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
rtx
gen_add3_insn (rtx r0, rtx r1, rtx c)
expr.h: Split out optab- and libfunc-related code to... * expr.h: Split out optab- and libfunc-related code to... * optabs.h, libfuncs.h: ... these new headers. * Makefile.in (CONFIG_H, EXPR_H): Take out insn-codes.h. (OPTABS_H): New. (various .o rules): Add $(OPTABS_H) and/or libfuncs.h to dependencies. * mkconfig.sh: Don't include insn-codes.h from config.h. * reload.h: Use #ifdef GCC_INSN_CODES_H to decide whether enum insn_code is available. Move reload_in_optab and reload_out_optab array declarations to optabs.h. * regmove.c (gen_add3_insn): Move to optabs.c, export from there, prototype in expr.h. * gencodes.c: Cleanup: zap global variables, don't use printf where puts will do, don't bother defining MAX_INSN_CODE which nothing uses, let CODE_FOR_nothing get its value implicitly. * genemit.c, genopinit.c: Include optabs.h in generated file. * genoutput.c: Include insn-codes.h in generated file. * builtins.c, caller-save.c, combine.c, doloop.c, explow.c, expmed.c, expr.c, function.c, ifcvt.c, loop.c, optabs.c, profile.c, reload1.c, simplify-rtx.c, stmt.c, unroll.c, config/alpha/alpha.c, config/arm/arm.c, config/c4x/c4x.c, config/clipper/clipper.c, config/i386/i386.c, config/ia64/ia64.c, config/mn10300/mn10300.c, config/pj/pj.c, config/sh/sh.c, config/sparc/sparc.c: Include optabs.h. * builtins.c, calls.c, dwarf2out.c, except.c, expr.c, function.c, optabs.c, stmt.c, config/c4x/c4x.c, config/clipper/clipper.c, config/m88k/m88k.c, config/sparc/sparc.c: Include libfuncs.h. * reload.c: Include expr.h and optabs.h before reload.h. * config/alpha/alpha.c: Include tree.h before reload.h. * config/pa/pa.c: Include expr.h, optabs.h, libfuncs.h, and reload.h in that order. * config/sparc/sparc.c: Include debug.h. * recog.c: Include insn-codes.h. cp: * Make-lang.in (cp/except.o): Add libfuncs.h to dependencies. * except.c: Include libfuncs.h. java: * Make-lang.in (java/decl.o): Update dependencies. * decl.c: Include libfuncs.h, don't include toplev.h. From-SVN: r44858
2001-08-13 17:56:51 +02:00
{
int icode = (int) 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_data[icode].operand[0].predicate
(r0, insn_data[icode].operand[0].mode))
|| !(insn_data[icode].operand[1].predicate
(r1, insn_data[icode].operand[1].mode))
|| !(insn_data[icode].operand[2].predicate
(c, insn_data[icode].operand[2].mode)))
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 NULL_RTX;
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
{
int icode;
gcc_assert (GET_MODE (x) != VOIDmode);
icode = (int) optab_handler (add_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
if (!(insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode))
|| !(insn_data[icode].operand[1].predicate
(x, insn_data[icode].operand[1].mode))
|| !(insn_data[icode].operand[2].predicate
(y, insn_data[icode].operand[2].mode)))
return 0;
return 1;
1991-12-30 04:19:53 +01:00
}
/* Generate and return an insn body to subtract Y from X. */
rtx
gen_sub2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
int icode = (int) optab_handler (sub_optab, GET_MODE (x));
1991-12-30 04:19:53 +01:00
gcc_assert (insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode));
gcc_assert (insn_data[icode].operand[1].predicate
(x, insn_data[icode].operand[1].mode));
gcc_assert (insn_data[icode].operand[2].predicate
(y, insn_data[icode].operand[2].mode));
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
gen_sub3_insn (rtx r0, rtx r1, rtx c)
{
int icode = (int) optab_handler (sub_optab, GET_MODE (r0));
if (icode == CODE_FOR_nothing
|| !(insn_data[icode].operand[0].predicate
(r0, insn_data[icode].operand[0].mode))
|| !(insn_data[icode].operand[1].predicate
(r1, insn_data[icode].operand[1].mode))
|| !(insn_data[icode].operand[2].predicate
(c, insn_data[icode].operand[2].mode)))
return NULL_RTX;
return GEN_FCN (icode) (r0, r1, c);
}
1991-12-30 04:19:53 +01:00
int
have_sub2_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
int icode;
gcc_assert (GET_MODE (x) != VOIDmode);
icode = (int) optab_handler (sub_optab, GET_MODE (x));
if (icode == CODE_FOR_nothing)
return 0;
if (!(insn_data[icode].operand[0].predicate
(x, insn_data[icode].operand[0].mode))
|| !(insn_data[icode].operand[1].predicate
(x, insn_data[icode].operand[1].mode))
|| !(insn_data[icode].operand[2].predicate
(y, insn_data[icode].operand[2].mode)))
return 0;
return 1;
1991-12-30 04:19:53 +01:00
}
/* Generate the body of an instruction to copy Y into X.
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
It may be a list of insns, if one insn isn't enough. */
1991-12-30 04:19:53 +01:00
rtx
gen_move_insn (rtx x, rtx y)
1991-12-30 04:19:53 +01:00
{
rtx seq;
1991-12-30 04:19:53 +01:00
start_sequence ();
emit_move_insn_1 (x, y);
Delete SEQUENCE rtl usage outside of reorg and ssa passes. 2002-06-05 David S. Miller <davem@redhat.com> Delete SEQUENCE rtl usage outside of reorg and ssa passes. * rtl.h (gen_sequence, emit_insns, emit_insns_before, emit_insns_before_scope, emit_insns_after, emit_insns_after_scope): Delete declaration. * ada/misc.c (insert_code_for): Use emit_insn* instead of emit_insns_foo. * config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE. (alpha_set_memflags): Fix comment. (set_frame_related_p): Use get_insns instead of gen_sequence. * config/alpha/alpha.md (setjmp receiver splitter): Avoid emitting no insns. * config/arm/arm.c (arm_finalize_pic): Use get_insns instead of gen_sequence. (arm_gen_load_multiple, arm_gen_store_multiple): Likewise. * config/fr30/fr30.c (fr30_move_double): Likewise. * config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr): Likewise. * config/ia64/ia64.c (spill_restore_mem): Likewise. * config/ia64/ia64.md (conditional move spliiter): Avoid emitting no insns. * config/m32r/m32r.c (gen_split_move_double): Use get_insns instead of gen_sequence. * config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise. (mips_expand_prologue, mips16_gp_pseudo_reg): Likewise. * config/sh/sh.c (sh_need_epilogue): Likewise. * config/sparc/sparc.md (current_function_calls_alloca, flat): New attributes. (setjmp pattern and split): Use them to avoid splitter which emits no RTL. * genattrtab.c (main): Emit include of function.h * config/stormy16/stormy16.c (xstormy16_split_cbranch): Use get_insns instead of gen_sequence. * config/cris/cris.c (cris_split_movdx): Likewise. * emit-rtl.c (emit_insns*): Kill. (try_split): Expect insn list instead of SEQUENCE. (make_jump_insn_raw, make_call_insn_raw): Fix comments. (emit_*insn*): Reimplement to work with INSN lists and PATTERNs. Make them abort if a SEQUENCE is given and RTL checking is enabled. (emit_*_scope): Don't forget to set scope on final insn. (gen_sequence): Move from here... * ssa.c (gen_sequence): To here as private function. * builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix comments. (expand_builtin_return, expand_builtin_mathfn): Likewise. (expand_builtin_strlen): Use get_insns instead of gen_sequence. (expand_builtin_saveregs): Use emit_insn_foo, fix comments. (expand_builtin_expect_jump): Use get_insns and fix comments. * calls.c (try_to_integrate): Use emit_insn_foo. (expand_call, emit_library_call_value_1): Likewise. * expr.c (emit_queue): Handle insn lists instead of SEQUENCE. (emit_move_insn_1): Use get_insns instead of gen_sequence. (expand_expr): Use emit_insn_foo. * cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo. * except.c (build_post_landing_pads): Likewise. * flow.c (attempt_auto_inc): Likewise. * stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label, expand_nl_goto_receivers, expand_decl_cleanup): Likewise. * function.c (fixup_var_refs_insn): Use get_insns instead of gen_sequence. (fixup_var_refs_1): Likewise and expect insn list from gen_foo. (fixup_memory_subreg): Use get_insns instead of gen_sequence. (fixup_stack_1, purge_addressof_1, expand_main_function, get_arg_pointer_save_area): Likewise. (optimize_bit_field, instantiate_virtual_regs_1, assign_parms, expand_function_end): Use emit_insn_foo. (record_insns, keep_stack_depressed): Work with insn list instead of SEQUENCE, fix comments. * ifcvt.c (noce_emit_store_flag, noce_try_store_flag, noce_try_store_flag_constants, noce_try_store_flag_inc, noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith, noce_try_minmax, noce_try_abs): Use emit_insn_foo. (noce_process_if_block): Use get_insns instead of gen_sequence. * optabs.c (add_equal_note): Work with insn list, fix comments. (expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo. (expand_unop, expand_complex_abs, expand_unop_insn, expand_no_conflict_block): Likewise. (gen_move_insn): Use get_insns instead of gen_sequence. (gen_cond_trap): Likewise. * integrate.c (copy_rtx_and_substitute): Likewise. (emit_initial_value_sets): Use emit_insn_foo. * reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise. (fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently now that RTL generators give insn lists. * sibcall.c (replace_call_placeholder): Use emit_insn_foo. * doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns instead of gen_sequence. (doloop_optimize): Work with insn lists instead of SEQUENCE rtl. * explow.c (emit_stack_save, emit_stack_restore): Use get_insns instead of gen_sequence. * loop.c (move_movables, emit_prefetch_instructions, gen_add_mult, check_dbra_loop, gen_load_of_final_value): Likewise. (loop_regs_update): Work with insn list instead of SEQUENCE rtl. (product_cheap_p): Likewise, and add commentary about RTL wastage here. * lcm.c (optimize_mode_switching): Use get_insns instead of gen_sequence. * profile.c (gen_edge_profiler): Likewise. * regmove.c (copy_src_to_dest): Likewise. * reg-stack.c (compensate_edge): Likewise and fix comment. * gcse.c (process_insert_insn): Likewise. (insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl. * jump.c (delete_prior_computation): Update comment. * genemit.c (gen_expand, gen_split, main): Use get_insns instead of gen_sequence, update comments to match. * recog.c (peephole2_optimize): Work with insn lists instead of SEQUENCE rtl. * sched-vis.c (print_pattern): Abort on SEQUENCE. * unroll.c (unroll_loop, find_splittable_givs, final_giv_value): Use get_insns instead of gen_sequence. (copy_loop_body): Likewise and don't emit dummy NOTE. * genrecog.c: Don't mention SEQUENCE rtl in comments. * combine.c (try_combine): Expect insn lists from split generator. * reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by hand. From-SVN: r54497
2002-06-11 14:22:48 +02:00
seq = get_insns ();
end_sequence ();
return seq;
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
can_extend_p (enum machine_mode to_mode, enum machine_mode from_mode,
int unsignedp)
1991-12-30 04:19:53 +01:00
{
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
convert_optab tab;
#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
gen_extend_insn (rtx x, rtx y, enum machine_mode mto,
enum machine_mode mfrom, int unsignedp)
1991-12-30 04:19:53 +01:00
{
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
enum insn_code icode = can_extend_p (mto, mfrom, unsignedp);
return GEN_FCN (icode) (x, y);
1991-12-30 04:19:53 +01:00
}
/* can_fix_p and can_float_p say whether the target machine
can directly convert a given fixed point type to
a given floating point type, or vice versa.
The returned value is the CODE_FOR_... value to use,
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
can_fix_p (enum machine_mode fixmode, enum machine_mode fltmode,
int unsignedp, int *truncp_ptr)
1991-12-30 04:19:53 +01:00
{
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
convert_optab tab;
enum insn_code icode;
tab = unsignedp ? ufixtrunc_optab : sfixtrunc_optab;
icode = 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;
}
static enum insn_code
can_float_p (enum machine_mode fltmode, enum machine_mode fixmode,
int unsignedp)
1991-12-30 04:19:53 +01:00
{
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
convert_optab tab;
tab = unsignedp ? ufloat_optab : sfloat_optab;
return convert_optab_handler (tab, fltmode, fixmode);
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;
1991-12-30 04:19:53 +01:00
enum 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_BITSIZE (GET_MODE (from)))
continue;
1991-12-30 04:19:53 +01:00
icode = can_float_p (fmode, imode, unsignedp);
if (icode == CODE_FOR_nothing && 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
{
rtx label = gen_label_rtx ();
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_BITSIZE (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_BITSIZE (GET_MODE (from)))
{
rtx temp1;
rtx 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 (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, integer_one_node,
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);
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, GET_MODE_BITSIZE (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;
1991-12-30 04:19:53 +01:00
rtx 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_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
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;
1991-12-30 04:19:53 +01:00
enum machine_mode fmode, imode;
int must_trunc = 0;
/* We first try to find a pair of modes, one real and one integer, at
least as wide as FROM and TO, respectively, in which we can open-code
this conversion. If the integer mode is wider than the mode of TO,
we can do the conversion either signed or unsigned. */
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)
{
rtx 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
1992-07-06 22:04:10 +02:00
if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_WIDE_INT)
1991-12-30 04:19:53 +01:00
for (fmode = GET_MODE (from); fmode != VOIDmode;
fmode = GET_MODE_WIDER_MODE (fmode))
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_BITSIZE (GET_MODE (to))))
1991-12-30 04:19:53 +01:00
{
int bitsize;
REAL_VALUE_TYPE offset;
rtx limit, lab1, lab2, insn;
bitsize = GET_MODE_BITSIZE (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 (gen_jump (lab2));
emit_barrier ();
/* Otherwise, subtract 2**(N-1), convert to signed number,
then add 2**(N-1). Do the addition using XOR since this
will often generate better code. */
emit_label (lab1);
target = expand_binop (GET_MODE (from), sub_optab, from, limit,
1992-07-06 22:04:10 +02:00
NULL_RTX, 0, OPTAB_LIB_WIDEN);
1991-12-30 04:19:53 +01:00
expand_fix (to, target, 0);
target = expand_binop (GET_MODE (to), xor_optab, to,
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_unique_reg_note (insn,
REG_EQUAL,
gen_rtx_fmt_e (UNSIGNED_FIX,
GET_MODE (to),
copy_rtx (from)));
}
1991-12-30 04:19:53 +01:00
return;
}
/* We can't do it with an insn, so use a library call. But first ensure
that the mode of TO is at least as wide as SImode, since those are the
only library calls we know about. */
if (GET_MODE_SIZE (GET_MODE (to)) < GET_MODE_SIZE (SImode))
{
target = gen_reg_rtx (SImode);
expand_fix (target, from, unsignedp);
}
else
{
rtx insns;
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)
{
enum machine_mode to_mode = GET_MODE (to);
enum machine_mode from_mode = GET_MODE (from);
convert_optab tab;
enum rtx_code this_code;
enum insn_code code;
rtx insns, value;
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 (tab->code, to_mode, from));
}
/* 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;
enum 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)
{
rtx 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
have_insn_for (enum rtx_code code, enum machine_mode mode)
{
return (code_to_optab[(int) code] != 0
&& (optab_handler (code_to_optab[(int) code], mode)
!= CODE_FOR_nothing));
}
/* Set all insn_code fields to CODE_FOR_nothing. */
static void
init_insn_codes (void)
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
{
memset (optab_table, 0, sizeof (optab_table));
memset (convert_optab_table, 0, sizeof (convert_optab_table));
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
memset (direct_optab_table, 0, sizeof (direct_optab_table));
* 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 OP's code to CODE, and write it into the code_to_optab table. */
static inline void
init_optab (optab op, enum rtx_code code)
{
op->code = code;
code_to_optab[(int) code] = op;
}
/* Same, but fill in its code as CODE, and do _not_ write it into
the code_to_optab table. */
static inline void
init_optabv (optab op, enum rtx_code code)
{
op->code = code;
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
/* Conversion optabs never go in the code_to_optab table. */
static void
init_convert_optab (convert_optab op, enum rtx_code code)
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
{
op->code = code;
}
/* 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
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_libfunc (optab optable, const char *opname, int suffix, enum 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);
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 *libfunc_name = XALLOCAVEC (char, 2 + opname_len + mname_len + 1 + 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
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++ = '_';
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. */
static 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,
enum 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;
if (GET_MODE_CLASS (mode) != MODE_INT)
return;
if (maxsize < LONG_LONG_TYPE_SIZE)
maxsize = LONG_LONG_TYPE_SIZE;
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
|| mode < word_mode || GET_MODE_BITSIZE (mode) > maxsize)
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. */
static 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,
enum 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. */
static void
gen_fixed_libfunc (optab optable, const char *opname, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_signed_fixed_libfunc (optab optable, const char *opname, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_unsigned_fixed_libfunc (optab optable, const char *opname, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_int_fp_libfunc (optab optable, const char *name, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_intv_fp_libfunc (optab optable, const char *name, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_int_fp_fixed_libfunc (optab optable, const char *name, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_int_fp_signed_fixed_libfunc (optab optable, const char *name, char suffix,
enum machine_mode mode)
{
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. */
static void
gen_int_fixed_libfunc (optab optable, const char *name, char suffix,
enum machine_mode 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 INT or signed FIXED operation is
involved. */
static void
gen_int_signed_fixed_libfunc (optab optable, const char *name, char suffix,
enum machine_mode 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 unsigned FIXED operation is
involved. */
static void
gen_int_unsigned_fixed_libfunc (optab optable, const char *name, char suffix,
enum machine_mode mode)
{
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
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
static void
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,
enum machine_mode tmode,
enum 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;
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
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] = '_';
memcpy (&nondec_name[2], opname, opname_len);
nondec_suffix = nondec_name + opname_len + 2;
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
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(fmode) || DECIMAL_FLOAT_MODE_P(tmode))
{
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. */
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
static void
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,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_ufloat_conv_libfunc (convert_optab tab,
const char *opname ATTRIBUTE_UNUSED,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_int_to_fp_nondecimal_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_fp_to_int_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_intraclass_conv_libfunc (convert_optab tab, const char *opname,
enum machine_mode tmode, enum 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;
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] = '_';
memcpy (&nondec_name[2], opname, opname_len);
nondec_suffix = nondec_name + opname_len + 2;
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
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(fmode) || DECIMAL_FLOAT_MODE_P(tmode))
{
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. */
static void
gen_trunc_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_extend_conv_libfunc (convert_optab tab,
const char *opname ATTRIBUTE_UNUSED,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_fract_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_fractuns_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_satfract_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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. */
static void
gen_satfractuns_conv_libfunc (convert_optab tab,
const char *opname,
enum machine_mode tmode,
enum machine_mode fmode)
{
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);
}
/* A table of previously-created libfuncs, hashed by name. */
static GTY ((param_is (union tree_node))) htab_t libfunc_decls;
/* Hashtable callbacks for libfunc_decls. */
static hashval_t
libfunc_decl_hash (const void *entry)
{
return IDENTIFIER_HASH_VALUE (DECL_NAME ((const_tree) entry));
}
static int
libfunc_decl_eq (const void *entry1, const void *entry2)
{
return DECL_NAME ((const_tree) entry1) == (const_tree) entry2;
}
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;
void **slot;
hashval_t hash;
if (libfunc_decls == NULL)
libfunc_decls = htab_create_ggc (37, libfunc_decl_hash,
libfunc_decl_eq, NULL);
/* See if we have already created a libfunc decl for this function. */
id = get_identifier (name);
hash = IDENTIFIER_HASH_VALUE (id);
slot = htab_find_slot_with_hash (libfunc_decls, id, hash, INSERT);
decl = (tree) *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;
void **slot;
hashval_t hash;
id = get_identifier (name);
hash = IDENTIFIER_HASH_VALUE (id);
slot = htab_find_slot_with_hash (libfunc_decls, 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
set_optab_libfunc (optab optable, enum machine_mode mode, const char *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
rtx val;
struct libfunc_entry e;
struct libfunc_entry **slot;
e.optab = (size_t) (optable - &optab_table[0]);
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 = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
if (*slot == NULL)
utils.c (init_gnat_to_gnu): Use typed GC allocation. gcc/ada: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): 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. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): 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. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): 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. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. From-SVN: r160425
2010-06-08 09:25:24 +02:00
*slot = ggc_alloc_libfunc_entry ();
(*slot)->optab = (size_t) (optable - &optab_table[0]);
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
set_conv_libfunc (convert_optab optable, enum machine_mode tmode,
enum machine_mode fmode, const char *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
rtx val;
struct libfunc_entry e;
struct libfunc_entry **slot;
e.optab = (size_t) (optable - &convert_optab_table[0]);
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 = (struct libfunc_entry **) htab_find_slot (libfunc_hash, &e, INSERT);
if (*slot == NULL)
utils.c (init_gnat_to_gnu): Use typed GC allocation. gcc/ada: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * gcc-interface/utils.c (init_gnat_to_gnu): Use typed GC allocation. (init_dummy_type): Likewise. (gnat_pushlevel): Likewise. * gcc-interface/trans.c (Attribute_to_gnu): Likewise. (Subprogram_Body_to_gnu): Likewise. (Compilation_Unit_to_gnu): Likewise. (start_stmt_group): Likewise. (extract_encoding): Likewise. (decode_name): Likewise. * gcc-interface/misc.c (gnat_printable_name): Likewise. * gcc-interface/decl.c (annotate_value): Likewise. * gcc-interface/ada-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. (SET_TYPE_LANG_SPECIFIC): Use typed GC allocation. (SET_DECL_LANG_SPECIFIC): Likewise. gcc/c-family: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * c-pragma.c (push_alignment): Use typed GC allocation. (handle_pragma_push_options): Likewise. * c-common.c (parse_optimize_options): Likewise. * c-common.h (struct sorted_fields_type): Add variable_size GTY option. gcc/cp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * typeck2.c (abstract_virtuals_error): Likewise. * pt.c (maybe_process_partial_specialization): Likewise. (register_specialization): Likewise. (add_pending_template): Likewise. (lookup_template_class): Likewise. (push_tinst_level): Likewise. * parser.c (cp_lexer_new_main): 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. * name-lookup.c (binding_entry_make): Likewise. (binding_table_construct): Likewise. (binding_table_new): Likewise. (cxx_binding_make): Likewise. (pushdecl_maybe_friend): Likewise. (begin_scope): Likewise. (push_to_top_level): Likewise. * lex.c (init_reswords): Likewise. (retrofit_lang_decl): Likewise. (cxx_dup_lang_specific_decl): Likewise. (copy_lang_type): Likewise. (cxx_make_type): Likewise. * decl.c (make_label_decl): Likewise. (check_goto): Likewise. (start_preparsed_function): Likewise. (save_function_data): Likewise. * cp-tree.h (TYPE_SET_PTRMEMFUNC_TYPE): Likewise. * cp-objcp-common.c (decl_shadowed_for_var_insert): Likewise. * class.c (finish_struct_1): Likewise. * cp-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * parser.c (cp_parser_new): Update comment to not reference ggc_alloc. gcc/fortran: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * trans-types.c (gfc_get_nodesc_array_type): Use typed GC allocation. (gfc_get_array_type_bounds): Likewise. * trans-decl.c (gfc_allocate_lang_decl): Likewise. (gfc_find_module): Likewise. * f95-lang.c (pushlevel): Likewise. * trans.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. gcc/java: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * jcf-reader.c (jcf_parse_constant_pool): Use typed GC allocation. * jcf-parse.c (java_parse_file): Likewise. (process_zip_dir): Likewise. * java-tree.h (MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC): Likewise. (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Likewise. * expr.c (add_type_assertion): Likewise. * decl.c (make_binding_level): Likewise. (java_dup_lang_specific_decl): Likewise. * constants.c (set_constant_entry): Likewise. (cpool_for_class): Likewise. * class.c (add_method_1): Likewise. (java_treetreehash_new): Likewise. * java-tree.h (struct lang_type): Add variable_size GTY option. (struct lang_decl): Likewise. * jch.h (struct cpool_entry): Likewise. * java-tree.h (java_treetreehash_create): Remove parameter ggc. * except.c (prepare_eh_table_type): Update java_treetreehash_create call. * class.c (add_method_1): Update java_treetreehash_create call. (java_treetreehash_create): Remove parameter gc. Use htab_create_ggc. gcc/lto: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * lto.c (lto_read_in_decl_state): Use typed GC allocation. (lto_file_read): Likewise. (new_partition): Likewise. (read_cgraph_and_symbols): Likewise. gcc/objc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objc-act.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. * objc-act.c (objc_volatilize_decl): Likewise. (objc_build_string_object): Likewise. (hash_init): Likewise. (hash_enter): Likewise. (hash_add_attr): Likewise. (add_class): Likewise. (start_class): Likewise. gcc/objcp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * objcp-decl.h (ALLOC_OBJC_TYPE_LANG_SPECIFIC): Use typed GC allocation. gcc: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * doc/tm.texi (Per-Function Data): Do not reference ggc_alloc. * doc/gty.texi (GTY Options): Document typed GC allocation and variable_size GTY option. * ggc-internal.h: New. * ggc.h: Update copyright year. (digit_string): Move to stringpool.c. (ggc_mark_stringpool, ggc_purge_stringpool, ggc_mark_roots) (gt_pch_save_stringpool, gt_pch_fixup_stringpool) (gt_pach_restore_stringpool, gt_pch_p_S, gt_pch_note_object) (init_ggc_pch, ggc_pch_count_object, ggc_pch_total_size) (ggc_pch_this_base, ggc_pch_alloc_object, ggc_pch_prepare_write) (ggc_pch_write_object, ggc_pch_finish, ggc_pch_read) (ggc_force_collect, ggc_get_size, ggc_statistics) (ggc_print_common_statistics): Move to ggc-internal.h. (digit_vector, new_ggc_zone, destroy_ggc_zone, ggc_alloc_stat) (ggc_alloc, ggc_alloc_cleared, ggc_realloc, ggc_calloc, GGC_NEW) (GGC_CNEW, GGC_NEWVEC, GGC_CNEWVEC, GGC_NEWVAR, ggc_alloc_rtvec) (ggc_alloc_tree, gt_pch_save, ggc_min_expand_heuristic) (ggc_min_heapsize_heuristic, ggc_alloc_zone) (ggc_alloc_zone_pass_stat): Remove. (ggc_internal_alloc_stat, ggc_internal_alloc) (ggc_internal_cleared_alloc_stat): New. (GGC_RESIZEVEC, GGC_RESIZEVAR): Redefine. (ggc_internal_vec_alloc_stat) (ggc_internal_cleared_vec_alloc_stat) (ggc_internal_vec_alloc_stat, ggc_internal_cleared_vec_alloc) (ggc_alloc_atomic_stat, ggc_alloc_atomic) (ggc_alloc_cleared_atomic, ggc_cleared_alloc_htab_ignore_args) (ggc_cleared_alloc_ptr_array_two_args): New. (htab_create_ggc, splay_tree_new_ggc): Redefine. (ggc_splay_alloc): Change the type of the first argument to enum gt_types_enum. (ggc_alloc_string): Make macro. (ggc_alloc_string_stat): New. (ggc_strdup): Redefine. (rtl_zone, tree_zone, tree_id_zone): Declare unconditionally. (ggc_alloc_rtvec_sized): New. (ggc_alloc_zone_stat): Rename to ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat, ggc_internal_alloc_zone_stat) (ggc_internal_cleared_alloc_zone_stat) (ggc_internal_zone_alloc_stat) (ggc_internal_zone_cleared_alloc_stat) (ggc_internal_zone_vec_alloc_stat) (ggc_alloc_zone_rtx_def_stat) (ggc_alloc_zone_tree_node_stat) (ggc_alloc_zone_cleared_tree_node_stat) (ggc_alloc_cleared_gimple_statement_d_stat): New. * ggc-common.c: Include ggc-internal.h. (ggc_internal_cleared_alloc_stat): Rename from ggc_alloc_cleared_stat. (ggc_realloc_stat): Use ggc_internal_alloc_stat. (ggc_calloc): Remove. (ggc_cleared_alloc_htab_ignore_args): New. (ggc_cleared_alloc_ptr_array_two_args): New. (ggc_splay_alloc): Add obj_type parameter. (init_ggc_heuristics): Formatting fixes. * ggc-none.c: Update copyright year. (ggc_alloc_stat): Rename to ggc_alloc_stat. (ggc_alloc_cleared_stat): Rename to ggc_internal_cleared_alloc_stat. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-page.c: Update copyright year. Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_typed_stat): Call ggc_internal_alloc_stat. (ggc_alloc_stat): Rename to ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. (struct alloc_zone, rtl_zone, tree_zone, tree_id_zone): New. * ggc-zone.c: Include ggc-internal.h. Remove references to ggc_alloc in comments. (ggc_alloc_zone_stat): ggc_internal_alloc_zone_stat. (ggc_internal_alloc_zone_pass_stat): New. (ggc_internal_cleared_alloc_zone_stat): New. (ggc_alloc_typed_stat): Use ggc_internal_alloc_zone_pass_stat. (ggc_alloc_stat): Rename ggc_internal_alloc_stat. (new_ggc_zone, destroy_ggc_zone): Remove. * stringpool.c: Update copyright year. Include ggc-internal.h (digit_vector): Make static. (digit_string): Moved from ggc.h. (stringpool_ggc_alloc): Use ggc_alloc_atomic. (ggc_alloc_string): Rename to ggc_alloc_string_stat. * Makefile.in (GGC_INTERNAL_H): New. (ggc_common.o, ggc-page.o, ggc-zone.o, stringpool.o): Add $(GGC_INTERNAL_H) to dependencies. * gentype.c: Update copyright year. (walk_type): Accept variable_size GTY option. (USED_BY_TYPED_GC_P): New macro. (write_enum_defn): Use USED_BY_TYPED_GC_P. Do not output whitespace at the end of strings. (get_type_specifier, variable_size_p): New functions. (alloc_quantity, alloc_zone): New enums. (write_typed_alloc_def): New function. (write_typed_struct_alloc_def): Likewise. (write_typed_typed_typedef_alloc_def): Likewise. (write_typed_alloc_defns): Likewise. (output_typename, write_splay_tree_allocator_def): Likewise. (write_splay_tree_allocators): Likewise. (main): Call write_typed_alloc_defns and write_splay_tree_allocators. * lto-streamer.h (lto_file_decl_data_ptr): New. * passes.c (order): Define using cgraph_node_ptr. * strinpool.c (struct string_pool_data): Declare nested_ptr using ht_identifier_ptr. * gimple.h (union gimple_statement_d): Likewise. * rtl.h (struct rtx_def): Likewise. (struct rtvec_def): Likewise. * tree.h (union tree_node): Likewise. * tree-ssa-operands.h (struct ssa_operand_memory_d): Likewise. * cfgloop.c (record_loop_exits): Use htab_create_ggc. * tree-scalar-evolution.c (scev_initialize): Likewise. * alias.c (record_alias_subset): Update splay_tree_new_ggc call. * dwarf2asm.c (dw2_force_const_mem): Likewise. * omp-low.c (lower_omp_critical): Likewise. * bitmap.h (struct bitmap_head_def): Update comment to not reference ggc_alloc. * config/pa/pa.c (get_deferred_label): Use GGC_RESIZEVEC. * ira.c (fix_reg_equiv_init): Use GGC_RESIZEVEC. * ipa-prop.c (duplicate_ggc_array): Rename to duplicate_ipa_jump_func_array. Use typed GC allocation. (ipa_edge_duplication_hook): Call duplicate_ipa_jump_func_array. * gimple.c (gimple_alloc_stat): Use ggc_alloc_cleared_gimple_statement_d_stat. * varasm.c (create_block_symbol): Use ggc_alloc_zone_rtx_def. * tree.c (make_node_stat): Use ggc_alloc_zone_cleared_tree_node_stat. (make_tree_vec_stat): Likewise. (build_vl_exp_stat): Likewise. (copy_node_stat): Use ggc_alloc_zone_tree_node_stat. (make_tree_binfo_stat): Likewise. (tree_cons_stat): Likewise. * rtl.c (rtx_alloc_stat): Use ggc_alloc_zone_rtx_def_stat. (shallow_copy_rtx_stat): Likewise. (make_node_stat): Likewise. * lto-symtab.c: Fix comment. * tree-cfg.c (create_bb): Update comment to not reference ggc_alloc_cleared. * tree-ssa-structalias.c (struct heapvar_for_stmt): Fix param_is value. * varpool.c (varpool_node): Use typed GC allocation. (varpool_extra_name_alias): Likewise. * varasm.c (emutls_decl): Likewise. (get_unnamed_section): Likewise. (get_noswitch_section): Likewise. (get_section): Likewise. (get_block_for_section): Likewise. (build_constant_desc): Likewise. (create_constant_pool): Likewise. (force_const_mem): Likewise. * tree.c (build_vl_exp_stat): Likewise. (build_real): Likewise. (build_string): Likewise. (decl_debug_expr_insert): Likewise. (decl_value_expr_insert): Likewise. (type_hash_add): Likewise. (build_omp_clause): Likewise. * tree-ssanames.c (duplicate_ssa_name_ptr_info): Likewise. * tree-ssa.c (init_tree_ssa): Likewise. * tree-ssa-structalias.c (heapvar_insert): Likewise. * tree-ssa-operands.c (ssa_operand_alloc): Likewise. * tree-ssa-loop-niter.c (record_estimate): Likewise. * tree-ssa-alias.c (get_ptr_info): Likewise. * tree-scalar-evolution.c (new_scev_info_str): Likewise. * tree-phinodes.c (allocate_phi_node): Likewise. * tree-iterator.c (tsi_link_before): Likewise. (tsi_link_after): Likewise. * tree-eh.c (add_stmt_to_eh_lp_fn): Likewise. * tree-dfa.c (create_var_ann): Likewise. * tree-cfg.c (create_bb): Likewise. * toplev.c (alloc_for_identifier_to_locale): Likewise. (general_init): Likewise. * stringpool.c (stringpool_ggc_alloc): Likewise. (gt_pch_save_stringpool): Likewise. * sese.c (if_region_set_false_region): Likewise. * passes.c (do_per_function_toporder): Likewise. * optabs.c (set_optab_libfunc): Likewise. (set_conv_libfunc): Likewise. * lto-symtab.c (lto_symtab_register_decl): Likewise. * lto-streamer-in.c (lto_input_eh_catch_list): Likewise. (input_eh_region): Likewise. (input_eh_lp): Likewise. (make_new_block): Likewise. (unpack_ts_real_cst_value_fields): Likewise. * lto-section-in.c (lto_new_in_decl_state): Likewise. * lto-cgraph.c (input_node_opt_summary): Likewise. * loop-init.c (loop_optimizer_init): Likewise. * lambda.h (lambda_vector_new): Likewise. * lambda-code.c (replace_uses_equiv_to_x_with_y): Likewise. * ira.c (update_equiv_regs): Likewise. * ipa.c (cgraph_node_set_new): Likewise. (cgraph_node_set_add): Likewise. (varpool_node_set_new): Likewise. (varpool_node_set_add): Likewise. * ipa-prop.c (ipa_compute_jump_functions_for_edge): Likewise. (duplicate_ipa_jump_func_array): Likewise. (ipa_read_node_info): Likewise. * ipa-cp.c (ipcp_create_replace_map): Likewise. * integrate.c (get_hard_reg_initial_val): Likewise. * gimple.c (gimple_alloc_stat): Likewise. (gimple_build_omp_for): Likewise. (gimple_seq_alloc): Likewise. (gimple_copy): Likewise. * gimple-iterator.c (gsi_insert_before_without_update): Likewise. (gsi_insert_after_without_update): Likewise. * function.c (add_frame_space): Likewise. (insert_temp_slot_address): Likewise. (assign_stack_temp_for_type): Likewise. (allocate_struct_function): Likewise. (types_used_by_var_decl_insert): 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. * emit-rtl.c (get_mem_attrs): Likewise. (get_reg_attrs): Likewise. (start_sequence): Likewise. (init_emit): Likewise. * dwarf2out.c (new_cfi): Likewise. (queue_reg_save): Likewise. (dwarf2out_frame_init): Likewise. (new_loc_descr): Likewise. (find_AT_string): 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. (loc_descriptor): Likewise. (add_loc_descr_to_each): Likewise. (add_const_value_attribute): Likewise. (tree_add_const_value_attribute): Likewise. (add_comp_dir_attribute): Likewise. (add_name_and_src_coords_attributes): Likewise. (lookup_filename): Likewise. (store_vcall_insn): Likewise. (dwarf2out_init): Likewise. * dbxout.c (dbxout_init): Likewise. * config/xtensa/xtensa.c (xtensa_init_machine_status): Likewise. * config/sparc/sparc.c (sparc_init_machine_status): Likewise. * config/score/score7.c (score7_output_external): Likewise. * config/score/score3.c (score3_output_external): Likewise. * config/s390/s390.c (s390_init_machine_status): Likewise. * config/rs6000/rs6000.c (builtin_function_type): Likewise. (rs6000_init_machine_status): Likewise. (output_toc): Likewise. * config/pa/pa.c (pa_init_machine_status): Likewise. (get_deferred_plabel): Likewise. * config/moxie/moxie.c (moxie_init_machine_status): Likewise. * config/mmix/mmix.c (mmix_init_machine_status): Likewise. * config/mips/mips.c (mflip_mips16_use_mips16_p): Likewise. * config/mep/mep.c (mep_init_machine_status): Likewise. (mep_note_pragma_flag): Likewise. * config/m32c/m32c.c (m32c_init_machine_status): Likewise. * config/iq2000/iq2000.c (iq2000_init_machine_status): Likewise. * config/ia64/ia64.c (ia64_init_machine_status): Likewise. * config/i386/winnt.c (i386_pe_record_external_function): Likewise. (i386_pe_maybe_record_exported_symbol): Likewise. * config/i386/i386.c (get_dllimport_decl): Likewise. (ix86_init_machine_status): Likewise. (assign_386_stack_local): Likewise. * config/frv/frv.c (frv_init_machine_status): Likewise. * config/darwin.c (machopic_indirection_name): Likewise. * config/cris/cris.c (cris_init_machine_status): Likewise. * config/bfin/bfin.c (bfin_init_machine_status): Likewise. * config/avr/avr.c (avr_init_machine_status): Likewise. * config/arm/arm.c (arm_init_machine_status): Likewise. * config/alpha/alpha.c (alpha_init_machine_status): Likewise. (alpha_need_linkage): Likewise. (alpha_use_linkage): Likewise. * cgraph.c (cgraph_allocate_node): Likewise. (cgraph_create_edge_1): Likewise. (cgraph_create_indirect_edge): Likewise. (cgraph_add_asm_node): Likewise. * cfgrtl.c (init_rtl_bb_info): Likewise. * cfgloop.c (alloc_loop): Likewise. (rescan_loop_exit): Likewise. * cfg.c (init_flow): Likewise. (alloc_block): Likewise. (unchecked_make_edge): Likewise. * c-parser.c (c_parse_init): Likewise. (c_parse_file): Likewise. * c-decl.c (bind): Likewise. (record_inline_static): Likewise. (push_scope): Likewise. (make_label): Likewise. (lookup_label_for_goto): Likewise. (finish_struct): Likewise. (finish_enum): Likewise. (c_push_function_context): Likewise. * bitmap.c (bitmap_element_allocate): Likewise. (bitmap_gc_alloc_stat): Likewise. * alias.c (record_alias_subset): Likewise. (init_alias_analysis): Likewise. include: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.h: Update copyright years. (splay_tree_s): Document fields. (splay_tree_new_typed_alloc): New. * hashtab.h: Update copyright years. (htab_create_typed_alloc): New. libcpp: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * include/symtab.h (ht_identifier_ptr): New. libiberty: 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com> * splay-tree.c: Update copyright years. (splay_tree_new_typed_alloc): New. (splay_tree_new_with_allocator): Use it. * hashtab.c: Update copyright years. (htab_create_typed_alloc): New. (htab_create_alloc): Use it. * functions.texi: Regenerate. From-SVN: r160425
2010-06-08 09:25:24 +02:00
*slot = ggc_alloc_libfunc_entry ();
(*slot)->optab = (size_t) (optable - &convert_optab_table[0]);
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)
{
htab_empty (libfunc_hash);
/* We statically initialize the insn_codes with the equivalent of
CODE_FOR_nothing. Repeat the process if reinitialising. */
init_insn_codes ();
}
else
libfunc_hash = htab_create_ggc (10, hash_libfunc, eq_libfunc, NULL);
init_optab (add_optab, PLUS);
init_optabv (addv_optab, PLUS);
init_optab (sub_optab, MINUS);
init_optabv (subv_optab, MINUS);
init_optab (ssadd_optab, SS_PLUS);
init_optab (usadd_optab, US_PLUS);
init_optab (sssub_optab, SS_MINUS);
init_optab (ussub_optab, US_MINUS);
init_optab (smul_optab, MULT);
init_optab (ssmul_optab, SS_MULT);
init_optab (usmul_optab, US_MULT);
init_optabv (smulv_optab, MULT);
init_optab (smul_highpart_optab, UNKNOWN);
init_optab (umul_highpart_optab, UNKNOWN);
init_optab (smul_widen_optab, UNKNOWN);
init_optab (umul_widen_optab, UNKNOWN);
init_optab (usmul_widen_optab, UNKNOWN);
init_optab (smadd_widen_optab, UNKNOWN);
init_optab (umadd_widen_optab, UNKNOWN);
init_optab (ssmadd_widen_optab, UNKNOWN);
init_optab (usmadd_widen_optab, UNKNOWN);
init_optab (smsub_widen_optab, UNKNOWN);
init_optab (umsub_widen_optab, UNKNOWN);
init_optab (ssmsub_widen_optab, UNKNOWN);
init_optab (usmsub_widen_optab, UNKNOWN);
init_optab (sdiv_optab, DIV);
init_optab (ssdiv_optab, SS_DIV);
init_optab (usdiv_optab, US_DIV);
init_optabv (sdivv_optab, DIV);
init_optab (sdivmod_optab, UNKNOWN);
init_optab (udiv_optab, UDIV);
init_optab (udivmod_optab, UNKNOWN);
init_optab (smod_optab, MOD);
init_optab (umod_optab, UMOD);
init_optab (fmod_optab, UNKNOWN);
init_optab (remainder_optab, UNKNOWN);
init_optab (ftrunc_optab, UNKNOWN);
init_optab (and_optab, AND);
init_optab (ior_optab, IOR);
init_optab (xor_optab, XOR);
init_optab (ashl_optab, ASHIFT);
init_optab (ssashl_optab, SS_ASHIFT);
init_optab (usashl_optab, US_ASHIFT);
init_optab (ashr_optab, ASHIFTRT);
init_optab (lshr_optab, LSHIFTRT);
init_optab (rotl_optab, ROTATE);
init_optab (rotr_optab, ROTATERT);
init_optab (smin_optab, SMIN);
init_optab (smax_optab, SMAX);
init_optab (umin_optab, UMIN);
init_optab (umax_optab, UMAX);
init_optab (pow_optab, UNKNOWN);
init_optab (atan2_optab, UNKNOWN);
init_optab (fma_optab, FMA);
init_optab (fms_optab, UNKNOWN);
init_optab (fnma_optab, UNKNOWN);
init_optab (fnms_optab, UNKNOWN);
/* These three have codes assigned exclusively for the sake of
have_insn_for. */
init_optab (mov_optab, SET);
init_optab (movstrict_optab, STRICT_LOW_PART);
init_optab (cbranch_optab, COMPARE);
init_optab (cmov_optab, UNKNOWN);
init_optab (cstore_optab, UNKNOWN);
init_optab (ctrap_optab, UNKNOWN);
init_optab (storent_optab, UNKNOWN);
init_optab (cmp_optab, UNKNOWN);
init_optab (ucmp_optab, UNKNOWN);
init_optab (eq_optab, EQ);
init_optab (ne_optab, NE);
init_optab (gt_optab, GT);
init_optab (ge_optab, GE);
init_optab (lt_optab, LT);
init_optab (le_optab, LE);
init_optab (unord_optab, UNORDERED);
init_optab (neg_optab, NEG);
init_optab (ssneg_optab, SS_NEG);
init_optab (usneg_optab, US_NEG);
init_optabv (negv_optab, NEG);
init_optab (abs_optab, ABS);
init_optabv (absv_optab, ABS);
init_optab (addcc_optab, UNKNOWN);
init_optab (one_cmpl_optab, NOT);
init_optab (bswap_optab, BSWAP);
init_optab (ffs_optab, FFS);
init_optab (clz_optab, CLZ);
init_optab (ctz_optab, CTZ);
init_optab (popcount_optab, POPCOUNT);
init_optab (parity_optab, PARITY);
init_optab (sqrt_optab, SQRT);
init_optab (floor_optab, UNKNOWN);
init_optab (ceil_optab, UNKNOWN);
init_optab (round_optab, UNKNOWN);
init_optab (btrunc_optab, UNKNOWN);
init_optab (nearbyint_optab, UNKNOWN);
init_optab (rint_optab, UNKNOWN);
init_optab (sincos_optab, UNKNOWN);
init_optab (sin_optab, UNKNOWN);
init_optab (asin_optab, UNKNOWN);
init_optab (cos_optab, UNKNOWN);
init_optab (acos_optab, UNKNOWN);
init_optab (exp_optab, UNKNOWN);
init_optab (exp10_optab, UNKNOWN);
init_optab (exp2_optab, UNKNOWN);
init_optab (expm1_optab, UNKNOWN);
init_optab (ldexp_optab, UNKNOWN);
init_optab (scalb_optab, UNKNOWN);
init_optab (significand_optab, UNKNOWN);
init_optab (logb_optab, UNKNOWN);
init_optab (ilogb_optab, UNKNOWN);
init_optab (log_optab, UNKNOWN);
init_optab (log10_optab, UNKNOWN);
init_optab (log2_optab, UNKNOWN);
init_optab (log1p_optab, UNKNOWN);
init_optab (tan_optab, UNKNOWN);
init_optab (atan_optab, UNKNOWN);
init_optab (copysign_optab, UNKNOWN);
init_optab (signbit_optab, UNKNOWN);
init_optab (isinf_optab, UNKNOWN);
init_optab (strlen_optab, UNKNOWN);
init_optab (push_optab, UNKNOWN);
init_optab (reduc_smax_optab, UNKNOWN);
init_optab (reduc_umax_optab, UNKNOWN);
init_optab (reduc_smin_optab, UNKNOWN);
init_optab (reduc_umin_optab, UNKNOWN);
init_optab (reduc_splus_optab, UNKNOWN);
init_optab (reduc_uplus_optab, UNKNOWN);
init_optab (ssum_widen_optab, UNKNOWN);
init_optab (usum_widen_optab, UNKNOWN);
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
init_optab (sdot_prod_optab, UNKNOWN);
init_optab (udot_prod_optab, UNKNOWN);
init_optab (vec_extract_optab, UNKNOWN);
init_optab (vec_extract_even_optab, UNKNOWN);
init_optab (vec_extract_odd_optab, UNKNOWN);
init_optab (vec_interleave_high_optab, UNKNOWN);
init_optab (vec_interleave_low_optab, UNKNOWN);
init_optab (vec_set_optab, UNKNOWN);
init_optab (vec_init_optab, UNKNOWN);
init_optab (vec_shl_optab, UNKNOWN);
init_optab (vec_shr_optab, UNKNOWN);
init_optab (vec_realign_load_optab, UNKNOWN);
init_optab (movmisalign_optab, UNKNOWN);
init_optab (vec_widen_umult_hi_optab, UNKNOWN);
init_optab (vec_widen_umult_lo_optab, UNKNOWN);
init_optab (vec_widen_smult_hi_optab, UNKNOWN);
init_optab (vec_widen_smult_lo_optab, UNKNOWN);
init_optab (vec_unpacks_hi_optab, UNKNOWN);
init_optab (vec_unpacks_lo_optab, UNKNOWN);
init_optab (vec_unpacku_hi_optab, UNKNOWN);
init_optab (vec_unpacku_lo_optab, UNKNOWN);
init_optab (vec_unpacks_float_hi_optab, UNKNOWN);
init_optab (vec_unpacks_float_lo_optab, UNKNOWN);
init_optab (vec_unpacku_float_hi_optab, UNKNOWN);
init_optab (vec_unpacku_float_lo_optab, UNKNOWN);
init_optab (vec_pack_trunc_optab, UNKNOWN);
init_optab (vec_pack_usat_optab, UNKNOWN);
init_optab (vec_pack_ssat_optab, UNKNOWN);
init_optab (vec_pack_ufix_trunc_optab, UNKNOWN);
init_optab (vec_pack_sfix_trunc_optab, UNKNOWN);
init_optab (powi_optab, UNKNOWN);
* libfuncs.h (LTI_extendsfdf2, LTI_extendsfxf2, LTI_extendsftf2) (LTI_extenddfxf2, LTI_extenddftf2, LTI_truncdfsf2, LTI_truncxfsf2) (LTI_trunctfsf2, LTI_truncxfdf2, LTI_trunctfdf2, LTI_floatsisf) (LTI_floatdisf, LTI_floattisf, LTI_floatsidf, LTI_floatdidf) (LTI_floattidf, LTI_floatsixf, LTI_floatdixf, LTI_floattixf) (LTI_floatsitf, LTI_floatditf, LTI_floattitf, LTI_fixsfsi, LTI_fixsfdi) (LTI_fixsfti, LTI_fixdfsi, LTI_fixdfdi, LTI_fixdfti, LTI_fixxfsi) (LTI_fixxfdi, LTI_fixxfti, LTI_fixtfsi, LTI_fixtfdi, LTI_fixtfti) (LTI_fixunssfsi, LTI_fixunssfdi, LTI_fixunssfti, LTI_fixunsdfsi) (LTI_fixunsdfdi, LTI_fixunsdfti, LTI_fixunsxfsi, LTI_fixunsxfdi) (LTI_fixunsxfti, LTI_fixunstfsi, LTI_fixunstfdi, LTI_fixunstfti) (extendsfdf2_libfunc, extendsfxf2_libfunc, extendsftf2_libfunc) (extenddfxf2_libfunc, extenddftf2_libfunc, truncdfsf2_libfunc) (truncxfsf2_libfunc, trunctfsf2_libfunc, truncxfdf2_libfunc) (trunctfdf2_libfunc, floatsisf_libfunc, floatdisf_libfunc) (floattisf_libfunc, floatsidf_libfunc, floatdidf_libfunc) (floattidf_libfunc, floatsixf_libfunc, floatdixf_libfunc) (floattixf_libfunc, floatsitf_libfunc, floatditf_libfunc) (floattitf_libfunc, fixsfsi_libfunc, fixsfdi_libfunc, fixsfti_libfunc) (fixdfsi_libfunc, fixdfdi_libfunc, fixdfti_libfunc, fixxfsi_libfunc) (fixxfdi_libfunc, fixxfti_libfunc, fixtfsi_libfunc, fixtfdi_libfunc) (fixtfti_libfunc, fixunssfsi_libfunc, fixunssfdi_libfunc) (fixunssfti_libfunc, fixunsdfsi_libfunc, fixunsdfdi_libfunc) (fixunsdfti_libfunc, fixunsxfsi_libfunc, fixunsxfdi_libfunc) (fixunsxfti_libfunc, fixunstfsi_libfunc, fixunstfdi_libfunc) (fixunstfti_libfunc): Delete. * optabs.h (struct optab_handlers): Break out of struct optab. (struct convert_optab, convert_optab, enum convert_optab_index, convert_optab_table, sext_optab, zext_optab, trunc_optab, sfix_optab, ufix_optab, sfixtrunc_optab, ufixtrunc_optab, sfloat_optab, ufloat_optab): New. (set_conv_libfunc): Prototype. (GEN_FCN): Use C90 indirect call syntax, remove unnecessary cast. (trunc_optab): Renamed btrunc_optab. * builtins.c (expand_builtin_mathfn): Update to match. * optabs.c (extendtab, fixtab, fixtrunctab, floattab): Delete. (convert_optab_table, new_convert_optab, init_convert_optab) (init_interclass_conv_libfuncs, init_intraclass_conv_libfuncs) (set_conv_libfunc): New. (can_extend_p, gen_extend_insn, can_fix_p, can_float_p) (expand_float, expand_fix): Use new conversion optabs, not old insn code tables or long chains of ifs. (init_optabs): No need to clear old insn code tables. Initialize the new optabs, not the old libfunc array entries. Don't handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * genopinit.c: Initialize conversion optabs, not the former insn code tables. Remove unnecessary casts. Handle FIXUNS_TRUNC_LIKE_FIX_TRUNC here. * expr.c (convert_move): Remove redundant check that to_real==from_real. Use the conversion optabs instead of long chains of tests of modes. Move partial-integer-mode interconversion above all integer conversion. Do not recurse on a value forced into a register in the original mode. * config/gofast.h, config/frv/frv.c, config/ia64/ia64.c * config/mips/mips.c, config/pa/pa.c, config/rs6000/rs6000.c * config/sparc/sparc.c: Use set_conv_libfunc to adjust entries in new conversion optabs; do not reference the old libfunc array entries. No need to include libfuncs.h. From-SVN: r72178
2003-10-07 04:23:42 +02:00
/* Conversions. */
init_convert_optab (sext_optab, SIGN_EXTEND);
init_convert_optab (zext_optab, ZERO_EXTEND);
init_convert_optab (trunc_optab, TRUNCATE);
init_convert_optab (sfix_optab, FIX);
init_convert_optab (ufix_optab, UNSIGNED_FIX);
init_convert_optab (sfixtrunc_optab, UNKNOWN);
init_convert_optab (ufixtrunc_optab, UNKNOWN);
init_convert_optab (sfloat_optab, FLOAT);
init_convert_optab (ufloat_optab, UNSIGNED_FLOAT);
init_convert_optab (lrint_optab, UNKNOWN);
init_convert_optab (lround_optab, UNKNOWN);
init_convert_optab (lfloor_optab, UNKNOWN);
init_convert_optab (lceil_optab, UNKNOWN);
init_convert_optab (fract_optab, FRACT_CONVERT);
init_convert_optab (fractuns_optab, UNSIGNED_FRACT_CONVERT);
init_convert_optab (satfract_optab, SAT_FRACT);
init_convert_optab (satfractuns_optab, UNSIGNED_SAT_FRACT);
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
/* Fill in the optabs with the insns we support. */
init_all_optabs ();
/* Initialize the optabs with the names of the library functions. */
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
add_optab->libcall_basename = "add";
add_optab->libcall_suffix = '3';
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
add_optab->libcall_gen = gen_int_fp_fixed_libfunc;
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
addv_optab->libcall_basename = "add";
addv_optab->libcall_suffix = '3';
addv_optab->libcall_gen = gen_intv_fp_libfunc;
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
ssadd_optab->libcall_basename = "ssadd";
ssadd_optab->libcall_suffix = '3';
ssadd_optab->libcall_gen = gen_signed_fixed_libfunc;
usadd_optab->libcall_basename = "usadd";
usadd_optab->libcall_suffix = '3';
usadd_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
sub_optab->libcall_basename = "sub";
sub_optab->libcall_suffix = '3';
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
sub_optab->libcall_gen = gen_int_fp_fixed_libfunc;
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
subv_optab->libcall_basename = "sub";
subv_optab->libcall_suffix = '3';
subv_optab->libcall_gen = gen_intv_fp_libfunc;
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
sssub_optab->libcall_basename = "sssub";
sssub_optab->libcall_suffix = '3';
sssub_optab->libcall_gen = gen_signed_fixed_libfunc;
ussub_optab->libcall_basename = "ussub";
ussub_optab->libcall_suffix = '3';
ussub_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
smul_optab->libcall_basename = "mul";
smul_optab->libcall_suffix = '3';
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
smul_optab->libcall_gen = gen_int_fp_fixed_libfunc;
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
smulv_optab->libcall_basename = "mul";
smulv_optab->libcall_suffix = '3';
smulv_optab->libcall_gen = gen_intv_fp_libfunc;
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
ssmul_optab->libcall_basename = "ssmul";
ssmul_optab->libcall_suffix = '3';
ssmul_optab->libcall_gen = gen_signed_fixed_libfunc;
usmul_optab->libcall_basename = "usmul";
usmul_optab->libcall_suffix = '3';
usmul_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
sdiv_optab->libcall_basename = "div";
sdiv_optab->libcall_suffix = '3';
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
sdiv_optab->libcall_gen = gen_int_fp_signed_fixed_libfunc;
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
sdivv_optab->libcall_basename = "divv";
sdivv_optab->libcall_suffix = '3';
sdivv_optab->libcall_gen = gen_int_libfunc;
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
ssdiv_optab->libcall_basename = "ssdiv";
ssdiv_optab->libcall_suffix = '3';
ssdiv_optab->libcall_gen = gen_signed_fixed_libfunc;
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
udiv_optab->libcall_basename = "udiv";
udiv_optab->libcall_suffix = '3';
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
udiv_optab->libcall_gen = gen_int_unsigned_fixed_libfunc;
usdiv_optab->libcall_basename = "usdiv";
usdiv_optab->libcall_suffix = '3';
usdiv_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
sdivmod_optab->libcall_basename = "divmod";
sdivmod_optab->libcall_suffix = '4';
sdivmod_optab->libcall_gen = gen_int_libfunc;
udivmod_optab->libcall_basename = "udivmod";
udivmod_optab->libcall_suffix = '4';
udivmod_optab->libcall_gen = gen_int_libfunc;
smod_optab->libcall_basename = "mod";
smod_optab->libcall_suffix = '3';
smod_optab->libcall_gen = gen_int_libfunc;
umod_optab->libcall_basename = "umod";
umod_optab->libcall_suffix = '3';
umod_optab->libcall_gen = gen_int_libfunc;
ftrunc_optab->libcall_basename = "ftrunc";
ftrunc_optab->libcall_suffix = '2';
ftrunc_optab->libcall_gen = gen_fp_libfunc;
and_optab->libcall_basename = "and";
and_optab->libcall_suffix = '3';
and_optab->libcall_gen = gen_int_libfunc;
ior_optab->libcall_basename = "ior";
ior_optab->libcall_suffix = '3';
ior_optab->libcall_gen = gen_int_libfunc;
xor_optab->libcall_basename = "xor";
xor_optab->libcall_suffix = '3';
xor_optab->libcall_gen = gen_int_libfunc;
ashl_optab->libcall_basename = "ashl";
ashl_optab->libcall_suffix = '3';
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
ashl_optab->libcall_gen = gen_int_fixed_libfunc;
ssashl_optab->libcall_basename = "ssashl";
ssashl_optab->libcall_suffix = '3';
ssashl_optab->libcall_gen = gen_signed_fixed_libfunc;
usashl_optab->libcall_basename = "usashl";
usashl_optab->libcall_suffix = '3';
usashl_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
ashr_optab->libcall_basename = "ashr";
ashr_optab->libcall_suffix = '3';
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
ashr_optab->libcall_gen = gen_int_signed_fixed_libfunc;
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
lshr_optab->libcall_basename = "lshr";
lshr_optab->libcall_suffix = '3';
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
lshr_optab->libcall_gen = gen_int_unsigned_fixed_libfunc;
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
smin_optab->libcall_basename = "min";
smin_optab->libcall_suffix = '3';
smin_optab->libcall_gen = gen_int_fp_libfunc;
smax_optab->libcall_basename = "max";
smax_optab->libcall_suffix = '3';
smax_optab->libcall_gen = gen_int_fp_libfunc;
umin_optab->libcall_basename = "umin";
umin_optab->libcall_suffix = '3';
umin_optab->libcall_gen = gen_int_libfunc;
umax_optab->libcall_basename = "umax";
umax_optab->libcall_suffix = '3';
umax_optab->libcall_gen = gen_int_libfunc;
neg_optab->libcall_basename = "neg";
neg_optab->libcall_suffix = '2';
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
neg_optab->libcall_gen = gen_int_fp_fixed_libfunc;
ssneg_optab->libcall_basename = "ssneg";
ssneg_optab->libcall_suffix = '2';
ssneg_optab->libcall_gen = gen_signed_fixed_libfunc;
usneg_optab->libcall_basename = "usneg";
usneg_optab->libcall_suffix = '2';
usneg_optab->libcall_gen = gen_unsigned_fixed_libfunc;
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
negv_optab->libcall_basename = "neg";
negv_optab->libcall_suffix = '2';
negv_optab->libcall_gen = gen_intv_fp_libfunc;
one_cmpl_optab->libcall_basename = "one_cmpl";
one_cmpl_optab->libcall_suffix = '2';
one_cmpl_optab->libcall_gen = gen_int_libfunc;
ffs_optab->libcall_basename = "ffs";
ffs_optab->libcall_suffix = '2';
ffs_optab->libcall_gen = gen_int_libfunc;
clz_optab->libcall_basename = "clz";
clz_optab->libcall_suffix = '2';
clz_optab->libcall_gen = gen_int_libfunc;
ctz_optab->libcall_basename = "ctz";
ctz_optab->libcall_suffix = '2';
ctz_optab->libcall_gen = gen_int_libfunc;
popcount_optab->libcall_basename = "popcount";
popcount_optab->libcall_suffix = '2';
popcount_optab->libcall_gen = gen_int_libfunc;
parity_optab->libcall_basename = "parity";
parity_optab->libcall_suffix = '2';
parity_optab->libcall_gen = gen_int_libfunc;
/* Comparison libcalls for integers MUST come in pairs,
signed/unsigned. */
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
cmp_optab->libcall_basename = "cmp";
cmp_optab->libcall_suffix = '2';
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
cmp_optab->libcall_gen = gen_int_fp_fixed_libfunc;
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
ucmp_optab->libcall_basename = "ucmp";
ucmp_optab->libcall_suffix = '2';
ucmp_optab->libcall_gen = gen_int_libfunc;
/* EQ etc are floating point only. */
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
eq_optab->libcall_basename = "eq";
eq_optab->libcall_suffix = '2';
eq_optab->libcall_gen = gen_fp_libfunc;
ne_optab->libcall_basename = "ne";
ne_optab->libcall_suffix = '2';
ne_optab->libcall_gen = gen_fp_libfunc;
gt_optab->libcall_basename = "gt";
gt_optab->libcall_suffix = '2';
gt_optab->libcall_gen = gen_fp_libfunc;
ge_optab->libcall_basename = "ge";
ge_optab->libcall_suffix = '2';
ge_optab->libcall_gen = gen_fp_libfunc;
lt_optab->libcall_basename = "lt";
lt_optab->libcall_suffix = '2';
lt_optab->libcall_gen = gen_fp_libfunc;
le_optab->libcall_basename = "le";
le_optab->libcall_suffix = '2';
le_optab->libcall_gen = gen_fp_libfunc;
unord_optab->libcall_basename = "unord";
unord_optab->libcall_suffix = '2';
unord_optab->libcall_gen = gen_fp_libfunc;
powi_optab->libcall_basename = "powi";
powi_optab->libcall_suffix = '2';
powi_optab->libcall_gen = gen_fp_libfunc;
/* Conversions. */
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
sfloat_optab->libcall_basename = "float";
sfloat_optab->libcall_gen = gen_int_to_fp_conv_libfunc;
ufloat_optab->libcall_gen = gen_ufloat_conv_libfunc;
sfix_optab->libcall_basename = "fix";
sfix_optab->libcall_gen = gen_fp_to_int_conv_libfunc;
ufix_optab->libcall_basename = "fixuns";
ufix_optab->libcall_gen = gen_fp_to_int_conv_libfunc;
lrint_optab->libcall_basename = "lrint";
lrint_optab->libcall_gen = gen_int_to_fp_nondecimal_conv_libfunc;
lround_optab->libcall_basename = "lround";
lround_optab->libcall_gen = gen_int_to_fp_nondecimal_conv_libfunc;
lfloor_optab->libcall_basename = "lfloor";
lfloor_optab->libcall_gen = gen_int_to_fp_nondecimal_conv_libfunc;
lceil_optab->libcall_basename = "lceil";
lceil_optab->libcall_gen = gen_int_to_fp_nondecimal_conv_libfunc;
/* trunc_optab is also used for FLOAT_EXTEND. */
sext_optab->libcall_basename = "extend";
sext_optab->libcall_gen = gen_extend_conv_libfunc;
trunc_optab->libcall_basename = "trunc";
trunc_optab->libcall_gen = gen_trunc_conv_libfunc;
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
/* Conversions for fixed-point modes and other modes. */
fract_optab->libcall_basename = "fract";
fract_optab->libcall_gen = gen_fract_conv_libfunc;
satfract_optab->libcall_basename = "satfract";
satfract_optab->libcall_gen = gen_satfract_conv_libfunc;
fractuns_optab->libcall_basename = "fractuns";
fractuns_optab->libcall_gen = gen_fractuns_conv_libfunc;
satfractuns_optab->libcall_basename = "satfractuns";
satfractuns_optab->libcall_gen = gen_satfractuns_conv_libfunc;
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. */
set_optab_libfunc (bswap_optab, SImode, "__bswapsi2");
set_optab_libfunc (bswap_optab, DImode, "__bswapdi2");
* 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)
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_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
/* 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;
int j;
int k;
/* Dump the arithmetic optabs. */
for (i = 0; i != (int) OTI_MAX; 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)
{
optab o;
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 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
o = &optab_table[i];
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
l = optab_libfunc (o, (enum 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",
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_RTX_NAME (o->code),
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 = 0; i < (int) COI_MAX; ++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)
{
convert_optab o;
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 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
o = &convert_optab_table[i];
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
l = convert_optab_libfunc (o, (enum machine_mode) j,
(enum 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",
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_RTX_NAME (o->code),
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
gen_cond_trap (enum rtx_code code, rtx op1, rtx op2, rtx tcode)
{
enum machine_mode mode = GET_MODE (op1);
enum insn_code icode;
rtx 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_data[icode].operand[3].predicate
&& !insn_data[icode].operand[3].predicate (tcode, VOIDmode))
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_RTX;
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. */
static 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;
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 (tree cond, bool unsignedp, enum insn_code icode)
{
enum rtx_code rcode;
tree t_op0, t_op1;
rtx rtx_op0, rtx_op1;
/* This is unlikely. While generating VEC_COND_EXPR, auto vectorizer
ensures that condition is a relational operation. */
gcc_assert (COMPARISON_CLASS_P (cond));
rcode = get_rtx_code (TREE_CODE (cond), unsignedp);
t_op0 = TREE_OPERAND (cond, 0);
t_op1 = TREE_OPERAND (cond, 1);
/* Expand operands. */
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);
rtx_op1 = expand_expr (t_op1, NULL_RTX, TYPE_MODE (TREE_TYPE (t_op1)),
EXPAND_STACK_PARM);
if (!insn_data[icode].operand[4].predicate (rtx_op0, GET_MODE (rtx_op0))
&& GET_MODE (rtx_op0) != VOIDmode)
rtx_op0 = force_reg (GET_MODE (rtx_op0), rtx_op0);
if (!insn_data[icode].operand[5].predicate (rtx_op1, GET_MODE (rtx_op1))
&& GET_MODE (rtx_op1) != VOIDmode)
rtx_op1 = force_reg (GET_MODE (rtx_op1), rtx_op1);
return gen_rtx_fmt_ee (rcode, VOIDmode, rtx_op0, rtx_op1);
}
/* Return insn code for TYPE, the type of a VEC_COND_EXPR. */
static inline enum insn_code
get_vcond_icode (tree type, enum machine_mode mode)
{
enum insn_code icode = CODE_FOR_nothing;
if (TYPE_UNSIGNED (type))
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 (vcondu_optab, mode);
else
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 (vcond_optab, mode);
return icode;
}
/* Return TRUE iff, appropriate vector insns are available
for vector cond expr with type TYPE in VMODE mode. */
bool
expand_vec_cond_expr_p (tree type, enum machine_mode vmode)
{
if (get_vcond_icode (type, vmode) == 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)
{
enum insn_code icode;
rtx comparison, rtx_op1, rtx_op2, cc_op0, cc_op1;
enum machine_mode mode = TYPE_MODE (vec_cond_type);
bool unsignedp = TYPE_UNSIGNED (vec_cond_type);
icode = get_vcond_icode (vec_cond_type, mode);
if (icode == CODE_FOR_nothing)
return 0;
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
target = gen_reg_rtx (mode);
/* Get comparison rtx. First expand both cond expr operands. */
comparison = vector_compare_rtx (op0,
unsignedp, icode);
cc_op0 = XEXP (comparison, 0);
cc_op1 = XEXP (comparison, 1);
/* Expand both operands and force them in reg, if required. */
rtx_op1 = expand_normal (op1);
if (!insn_data[icode].operand[1].predicate (rtx_op1, mode)
&& mode != VOIDmode)
rtx_op1 = force_reg (mode, rtx_op1);
rtx_op2 = expand_normal (op2);
if (!insn_data[icode].operand[2].predicate (rtx_op2, mode)
&& mode != VOIDmode)
rtx_op2 = force_reg (mode, rtx_op2);
/* Emit instruction! */
emit_insn (GEN_FCN (icode) (target, rtx_op1, rtx_op2,
comparison, cc_op0, cc_op1));
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
/* This is an internal subroutine of the other compare_and_swap expanders.
MEM, OLD_VAL and NEW_VAL are as you'd expect for a compare-and-swap
operation. TARGET is an optional place to store the value result of
the operation. ICODE is the particular instruction to expand. Return
the result of the operation. */
static rtx
expand_val_compare_and_swap_1 (rtx mem, rtx old_val, rtx new_val,
rtx target, enum insn_code icode)
{
enum machine_mode mode = GET_MODE (mem);
rtx insn;
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
target = gen_reg_rtx (mode);
if (GET_MODE (old_val) != VOIDmode && GET_MODE (old_val) != mode)
old_val = convert_modes (mode, GET_MODE (old_val), old_val, 1);
if (!insn_data[icode].operand[2].predicate (old_val, mode))
old_val = force_reg (mode, old_val);
if (GET_MODE (new_val) != VOIDmode && GET_MODE (new_val) != mode)
new_val = convert_modes (mode, GET_MODE (new_val), new_val, 1);
if (!insn_data[icode].operand[3].predicate (new_val, mode))
new_val = force_reg (mode, new_val);
insn = GEN_FCN (icode) (target, mem, old_val, new_val);
if (insn == NULL_RTX)
return NULL_RTX;
emit_insn (insn);
return target;
}
/* Expand a compare-and-swap operation and return its value. */
rtx
expand_val_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
{
enum machine_mode mode = GET_MODE (mem);
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
enum insn_code icode
= direct_optab_handler (sync_compare_and_swap_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)
return NULL_RTX;
return expand_val_compare_and_swap_1 (mem, old_val, new_val, target, icode);
}
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
/* Expand a compare-and-swap operation and store true into the result if
the operation was successful and false otherwise. Return the result.
Unlike other routines, TARGET is not optional. */
rtx
expand_bool_compare_and_swap (rtx mem, rtx old_val, rtx new_val, rtx target)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code icode;
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
rtx subtarget, seq, cc_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 the target supports a compare-and-swap pattern that simultaneously
sets some flag for success, then use it. Otherwise use the regular
compare-and-swap and follow that immediately with a compare insn. */
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 (sync_compare_and_swap_optab, mode);
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 (icode == CODE_FOR_nothing)
return NULL_RTX;
do_pending_stack_adjust ();
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
do
{
start_sequence ();
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
subtarget = expand_val_compare_and_swap_1 (mem, old_val, new_val,
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
NULL_RTX, icode);
cc_reg = 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
if (subtarget == NULL_RTX)
{
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
end_sequence ();
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
}
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 (have_insn_for (COMPARE, CCmode))
note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
seq = get_insns ();
end_sequence ();
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
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
/* We might be comparing against an old value. Try again. :-( */
if (!cc_reg && MEM_P (old_val))
{
seq = NULL_RTX;
old_val = force_reg (mode, old_val);
}
}
while (!seq);
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
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
emit_insn (seq);
if (cc_reg)
return emit_store_flag_force (target, EQ, cc_reg, const0_rtx, VOIDmode, 0, 1);
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
else
return emit_store_flag_force (target, EQ, subtarget, old_val, VOIDmode, 1, 1);
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)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code icode;
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
rtx label, cmp_reg, subtarget, cc_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
/* 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;
cmp_reg = compare-and-swap(mem, old_reg, new_reg)
if (cmp_reg != old_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
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);
/* If the target supports a compare-and-swap pattern that simultaneously
sets some flag for success, then use it. Otherwise use the regular
compare-and-swap and follow that immediately with a compare insn. */
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 (sync_compare_and_swap_optab, mode);
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 (icode == CODE_FOR_nothing)
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
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
subtarget = expand_val_compare_and_swap_1 (mem, old_reg, new_reg,
cmp_reg, icode);
if (subtarget == NULL_RTX)
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
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
cc_reg = NULL_RTX;
if (have_insn_for (COMPARE, CCmode))
note_stores (PATTERN (get_last_insn ()), find_cc_set, &cc_reg);
if (cc_reg)
{
cmp_reg = cc_reg;
old_reg = const0_rtx;
}
else
{
if (subtarget != cmp_reg)
emit_move_insn (cmp_reg, subtarget);
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
}
/* ??? Mark this jump predicted not taken? */
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
emit_cmp_and_jump_insns (cmp_reg, old_reg, NE, const0_rtx, GET_MODE (cmp_reg), 1,
label);
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;
}
/* This function generates the atomic operation MEM CODE= VAL. In this
case, we do not care about any resulting value. Returns NULL if we
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
cannot generate the operation. */
rtx
expand_sync_operation (rtx mem, rtx val, enum rtx_code code)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code icode;
rtx insn;
/* Look to see if the target supports the operation directly. */
switch (code)
{
case PLUS:
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 (sync_add_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
break;
case IOR:
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 (sync_ior_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
break;
case XOR:
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 (sync_xor_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
break;
case AND:
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 (sync_and_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
break;
case NOT:
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 (sync_nand_optab, mode);
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 MINUS:
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 (sync_sub_optab, mode);
if (icode == CODE_FOR_nothing || CONST_INT_P (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
{
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 (sync_add_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)
{
val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
code = PLUS;
}
}
break;
default:
gcc_unreachable ();
}
/* Generate the direct operation, if present. */
if (icode != CODE_FOR_nothing)
{
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
val = convert_modes (mode, GET_MODE (val), val, 1);
if (!insn_data[icode].operand[1].predicate (val, mode))
val = force_reg (mode, 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
insn = GEN_FCN (icode) (mem, val);
if (insn)
{
emit_insn (insn);
return const0_rtx;
}
}
/* Failing that, generate a compare-and-swap loop in which we perform the
operation with normal arithmetic instructions. */
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 (sync_compare_and_swap_optab, mode)
!= 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
{
rtx t0 = gen_reg_rtx (mode), t1;
start_sequence ();
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
insn = get_insns ();
end_sequence ();
if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn))
return const0_rtx;
}
return NULL_RTX;
}
/* This function generates the atomic operation MEM CODE= VAL. In this
case, we do care about the resulting value: if AFTER is true then
return the value MEM holds after the operation, if AFTER is 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
then return the value MEM holds before the operation. TARGET is an
optional place for the result value to be stored. */
rtx
expand_sync_fetch_operation (rtx mem, rtx val, enum rtx_code code,
bool after, rtx target)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code old_code, new_code, icode;
bool compensate;
rtx insn;
/* Look to see if the target supports the operation directly. */
switch (code)
{
case PLUS:
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
old_code = direct_optab_handler (sync_old_add_optab, mode);
new_code = direct_optab_handler (sync_new_add_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
break;
case IOR:
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
old_code = direct_optab_handler (sync_old_ior_optab, mode);
new_code = direct_optab_handler (sync_new_ior_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
break;
case XOR:
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
old_code = direct_optab_handler (sync_old_xor_optab, mode);
new_code = direct_optab_handler (sync_new_xor_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
break;
case AND:
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
old_code = direct_optab_handler (sync_old_and_optab, mode);
new_code = direct_optab_handler (sync_new_and_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
break;
case NOT:
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
old_code = direct_optab_handler (sync_old_nand_optab, mode);
new_code = direct_optab_handler (sync_new_nand_optab, mode);
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 MINUS:
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
old_code = direct_optab_handler (sync_old_sub_optab, mode);
new_code = direct_optab_handler (sync_new_sub_optab, mode);
if ((old_code == CODE_FOR_nothing && new_code == CODE_FOR_nothing)
|| CONST_INT_P (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
{
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
old_code = direct_optab_handler (sync_old_add_optab, mode);
new_code = direct_optab_handler (sync_new_add_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 (old_code != CODE_FOR_nothing || new_code != CODE_FOR_nothing)
{
val = expand_simple_unop (mode, NEG, val, NULL_RTX, 1);
code = PLUS;
}
}
break;
default:
gcc_unreachable ();
}
/* If the target does supports the proper new/old operation, great. But
if we only support the opposite old/new operation, check to see if we
can compensate. In the case in which the old value is supported, then
we can always perform the operation again with normal arithmetic. In
the case in which the new value is supported, then we can only handle
this in the case the operation is reversible. */
compensate = false;
if (after)
{
icode = new_code;
if (icode == CODE_FOR_nothing)
{
icode = old_code;
if (icode != CODE_FOR_nothing)
compensate = true;
}
}
else
{
icode = old_code;
if (icode == CODE_FOR_nothing
&& (code == PLUS || code == MINUS || code == XOR))
{
icode = new_code;
if (icode != CODE_FOR_nothing)
compensate = true;
}
}
/* If we found something supported, great. */
if (icode != CODE_FOR_nothing)
{
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
target = gen_reg_rtx (mode);
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
val = convert_modes (mode, GET_MODE (val), val, 1);
if (!insn_data[icode].operand[2].predicate (val, mode))
val = force_reg (mode, 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
insn = GEN_FCN (icode) (target, mem, val);
if (insn)
{
emit_insn (insn);
/* If we need to compensate for using an operation with the
wrong return value, do so now. */
if (compensate)
{
if (!after)
{
if (code == PLUS)
code = MINUS;
else if (code == MINUS)
code = PLUS;
}
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
{
target = expand_simple_binop (mode, AND, target, val,
NULL_RTX, true,
OPTAB_LIB_WIDEN);
target = expand_simple_unop (mode, code, target,
NULL_RTX, true);
}
else
target = expand_simple_binop (mode, code, target, 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
}
return target;
}
}
/* Failing that, generate a compare-and-swap loop in which we perform the
operation with normal arithmetic instructions. */
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 (sync_compare_and_swap_optab, mode)
!= 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
{
rtx t0 = gen_reg_rtx (mode), t1;
if (!target || !register_operand (target, mode))
target = gen_reg_rtx (mode);
start_sequence ();
if (!after)
emit_move_insn (target, t0);
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
if (after)
emit_move_insn (target, t1);
insn = get_insns ();
end_sequence ();
if (t1 != NULL && expand_compare_and_swap_loop (mem, t0, t1, insn))
return target;
}
return NULL_RTX;
}
/* This function expands a test-and-set operation. Ideally we atomically
store VAL in MEM and return the previous value in MEM. Some targets
may not support this operation and only support VAL with the constant 1;
in this case while the return value will be 0/1, but the exact 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
stored in MEM is target defined. TARGET is an option place to stick
the return value. */
rtx
expand_sync_lock_test_and_set (rtx mem, rtx val, rtx target)
{
enum machine_mode mode = GET_MODE (mem);
enum insn_code icode;
rtx insn;
/* If the target supports the test-and-set directly, great. */
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 (sync_lock_test_and_set_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)
{
if (!target || !insn_data[icode].operand[0].predicate (target, mode))
target = gen_reg_rtx (mode);
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
val = convert_modes (mode, GET_MODE (val), val, 1);
if (!insn_data[icode].operand[2].predicate (val, mode))
val = force_reg (mode, val);
insn = GEN_FCN (icode) (target, mem, val);
if (insn)
{
emit_insn (insn);
return target;
}
}
/* Otherwise, use a compare-and-swap loop for the exchange. */
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 (sync_compare_and_swap_optab, mode)
!= 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
{
if (!target || !register_operand (target, mode))
target = gen_reg_rtx (mode);
if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode)
val = convert_modes (mode, GET_MODE (val), val, 1);
if (expand_compare_and_swap_loop (mem, target, val, NULL_RTX))
return target;
}
return NULL_RTX;
}
#include "gt-optabs.h"