2000-04-18 20:14:10 +02:00
|
|
|
|
/* RTL simplification functions for GNU compiler.
|
2000-02-26 15:26:24 +01:00
|
|
|
|
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
2002-03-07 14:38:22 +01:00
|
|
|
|
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
This file is part of GCC.
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
|
version.
|
1999-11-01 01:18:23 +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.
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
|
02111-1307, USA. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "tm_p.h"
|
|
|
|
|
#include "regs.h"
|
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "real.h"
|
|
|
|
|
#include "insn-config.h"
|
|
|
|
|
#include "recog.h"
|
|
|
|
|
#include "function.h"
|
|
|
|
|
#include "expr.h"
|
|
|
|
|
#include "toplev.h"
|
|
|
|
|
#include "output.h"
|
2000-03-14 19:36:18 +01:00
|
|
|
|
#include "ggc.h"
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* Simplification and canonicalization of RTL. */
|
|
|
|
|
|
|
|
|
|
/* Nonzero if X has the form (PLUS frame-pointer integer). We check for
|
|
|
|
|
virtual regs here because the simplify_*_operation routines are called
|
|
|
|
|
by integrate.c, which is called before virtual register instantiation.
|
|
|
|
|
|
2002-05-09 14:02:29 +02:00
|
|
|
|
?!? FIXED_BASE_PLUS_P and NONZERO_BASE_PLUS_P need to move into
|
1999-11-01 01:18:23 +01:00
|
|
|
|
a header file so that their definitions can be shared with the
|
|
|
|
|
simplification routines in simplify-rtx.c. Until then, do not
|
|
|
|
|
change these macros without also changing the copy in simplify-rtx.c. */
|
|
|
|
|
|
|
|
|
|
#define FIXED_BASE_PLUS_P(X) \
|
|
|
|
|
((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
|
|
|
|
|
|| ((X) == arg_pointer_rtx && fixed_regs[ARG_POINTER_REGNUM])\
|
|
|
|
|
|| (X) == virtual_stack_vars_rtx \
|
|
|
|
|
|| (X) == virtual_incoming_args_rtx \
|
|
|
|
|
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
|
|
|
|
|
&& (XEXP (X, 0) == frame_pointer_rtx \
|
|
|
|
|
|| XEXP (X, 0) == hard_frame_pointer_rtx \
|
|
|
|
|
|| ((X) == arg_pointer_rtx \
|
|
|
|
|
&& fixed_regs[ARG_POINTER_REGNUM]) \
|
|
|
|
|
|| XEXP (X, 0) == virtual_stack_vars_rtx \
|
|
|
|
|
|| XEXP (X, 0) == virtual_incoming_args_rtx)) \
|
|
|
|
|
|| GET_CODE (X) == ADDRESSOF)
|
|
|
|
|
|
|
|
|
|
/* Similar, but also allows reference to the stack pointer.
|
|
|
|
|
|
|
|
|
|
This used to include FIXED_BASE_PLUS_P, however, we can't assume that
|
|
|
|
|
arg_pointer_rtx by itself is nonzero, because on at least one machine,
|
|
|
|
|
the i960, the arg pointer is zero when it is unused. */
|
|
|
|
|
|
|
|
|
|
#define NONZERO_BASE_PLUS_P(X) \
|
|
|
|
|
((X) == frame_pointer_rtx || (X) == hard_frame_pointer_rtx \
|
|
|
|
|
|| (X) == virtual_stack_vars_rtx \
|
|
|
|
|
|| (X) == virtual_incoming_args_rtx \
|
|
|
|
|
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
|
|
|
|
|
&& (XEXP (X, 0) == frame_pointer_rtx \
|
|
|
|
|
|| XEXP (X, 0) == hard_frame_pointer_rtx \
|
|
|
|
|
|| ((X) == arg_pointer_rtx \
|
|
|
|
|
&& fixed_regs[ARG_POINTER_REGNUM]) \
|
|
|
|
|
|| XEXP (X, 0) == virtual_stack_vars_rtx \
|
|
|
|
|
|| XEXP (X, 0) == virtual_incoming_args_rtx)) \
|
|
|
|
|
|| (X) == stack_pointer_rtx \
|
|
|
|
|
|| (X) == virtual_stack_dynamic_rtx \
|
|
|
|
|
|| (X) == virtual_outgoing_args_rtx \
|
|
|
|
|
|| (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 1)) == CONST_INT \
|
|
|
|
|
&& (XEXP (X, 0) == stack_pointer_rtx \
|
|
|
|
|
|| XEXP (X, 0) == virtual_stack_dynamic_rtx \
|
|
|
|
|
|| XEXP (X, 0) == virtual_outgoing_args_rtx)) \
|
|
|
|
|
|| GET_CODE (X) == ADDRESSOF)
|
|
|
|
|
|
2000-05-23 20:06:22 +02:00
|
|
|
|
/* Much code operates on (low, high) pairs; the low value is an
|
|
|
|
|
unsigned wide int, the high value a signed wide int. We
|
|
|
|
|
occasionally need to sign extend from low to high as if low were a
|
|
|
|
|
signed wide int. */
|
2000-05-24 22:26:54 +02:00
|
|
|
|
#define HWI_SIGN_EXTEND(low) \
|
2000-05-23 20:06:22 +02:00
|
|
|
|
((((HOST_WIDE_INT) low) < 0) ? ((HOST_WIDE_INT) -1) : ((HOST_WIDE_INT) 0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-12-13 02:21:52 +01:00
|
|
|
|
static rtx neg_const_int PARAMS ((enum machine_mode, rtx));
|
2001-09-07 20:14:32 +02:00
|
|
|
|
static int simplify_plus_minus_op_data_cmp PARAMS ((const void *,
|
|
|
|
|
const void *));
|
2000-04-18 20:14:10 +02:00
|
|
|
|
static rtx simplify_plus_minus PARAMS ((enum rtx_code,
|
2002-02-22 00:06:16 +01:00
|
|
|
|
enum machine_mode, rtx,
|
|
|
|
|
rtx, int));
|
2001-12-13 02:21:52 +01:00
|
|
|
|
|
|
|
|
|
/* Negate a CONST_INT rtx, truncating (because a conversion from a
|
2001-12-28 19:17:54 +01:00
|
|
|
|
maximally negative number can overflow). */
|
2001-12-13 02:21:52 +01:00
|
|
|
|
static rtx
|
|
|
|
|
neg_const_int (mode, i)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx i;
|
|
|
|
|
{
|
emit-rtl.c (gen_int_mode): New function.
* emit-rtl.c (gen_int_mode): New function.
* rtl.h: Prototype for it.
* combine.c (make_extraction, simplify_comparison), expmed.c
(store_bit_field, expand_mult_highpart, expand_divmod), expr.c
(convert_modes, store_field), optabs.c (expand_fix),
simplify-rtx.c (neg_const_int, simplify_unary_real),
* config/rs6000/rs6000.c, config/rs6000/rs6000.md:
Use it instead of GEN_INT (trunc_int_for_mode (...)).
From-SVN: r51030
2002-03-19 19:00:43 +01:00
|
|
|
|
return gen_int_mode (- INTVAL (i), mode);
|
2001-12-13 02:21:52 +01:00
|
|
|
|
}
|
|
|
|
|
|
2000-04-18 20:14:10 +02:00
|
|
|
|
|
2002-05-09 14:02:29 +02:00
|
|
|
|
/* Make a binary operation by properly ordering the operands and
|
1999-11-01 01:18:23 +01:00
|
|
|
|
seeing if the expression folds. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_gen_binary (code, mode, op0, op1)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op0, op1;
|
|
|
|
|
{
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
/* Put complex operands first and constants second if commutative. */
|
|
|
|
|
if (GET_RTX_CLASS (code) == 'c'
|
2001-05-17 23:21:21 +02:00
|
|
|
|
&& swap_commutative_operands_p (op0, op1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
tem = op0, op0 = op1, op1 = tem;
|
|
|
|
|
|
|
|
|
|
/* If this simplifies, do it. */
|
|
|
|
|
tem = simplify_binary_operation (code, mode, op0, op1);
|
|
|
|
|
if (tem)
|
|
|
|
|
return tem;
|
|
|
|
|
|
2002-02-22 00:06:16 +01:00
|
|
|
|
/* Handle addition and subtraction specially. Otherwise, just form
|
|
|
|
|
the operation. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-02-22 00:06:16 +01:00
|
|
|
|
if (code == PLUS || code == MINUS)
|
2002-03-07 00:07:08 +01:00
|
|
|
|
{
|
|
|
|
|
tem = simplify_plus_minus (code, mode, op0, op1, 1);
|
|
|
|
|
if (tem)
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return gen_rtx_fmt_ee (code, mode, op0, op1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-25 01:43:55 +02:00
|
|
|
|
/* If X is a MEM referencing the constant pool, return the real value.
|
2001-07-17 17:11:56 +02:00
|
|
|
|
Otherwise return X. */
|
2001-07-27 01:47:15 +02:00
|
|
|
|
rtx
|
2001-07-17 17:11:56 +02:00
|
|
|
|
avoid_constant_pool_reference (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
2001-07-25 01:43:55 +02:00
|
|
|
|
rtx c, addr;
|
|
|
|
|
enum machine_mode cmode;
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (x) != MEM)
|
|
|
|
|
return x;
|
2001-07-25 01:43:55 +02:00
|
|
|
|
addr = XEXP (x, 0);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (addr) != SYMBOL_REF
|
|
|
|
|
|| ! CONSTANT_POOL_ADDRESS_P (addr))
|
2001-07-17 17:11:56 +02:00
|
|
|
|
return x;
|
2001-07-25 01:43:55 +02:00
|
|
|
|
|
|
|
|
|
c = get_pool_constant (addr);
|
|
|
|
|
cmode = get_pool_mode (addr);
|
|
|
|
|
|
|
|
|
|
/* If we're accessing the constant in a different mode than it was
|
|
|
|
|
originally stored, attempt to fix that up via subreg simplifications.
|
|
|
|
|
If that fails we have no choice but to return the original memory. */
|
|
|
|
|
if (cmode != GET_MODE (x))
|
|
|
|
|
{
|
|
|
|
|
c = simplify_subreg (GET_MODE (x), c, cmode, 0);
|
|
|
|
|
return c ? c : x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return c;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
}
|
|
|
|
|
|
2001-02-13 21:43:13 +01:00
|
|
|
|
/* Make a unary operation by first seeing if it folds and otherwise making
|
|
|
|
|
the specified operation. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_gen_unary (code, mode, op, op_mode)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op;
|
|
|
|
|
enum machine_mode op_mode;
|
|
|
|
|
{
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
/* If this simplifies, use it. */
|
|
|
|
|
if ((tem = simplify_unary_operation (code, mode, op, op_mode)) != 0)
|
|
|
|
|
return tem;
|
|
|
|
|
|
|
|
|
|
return gen_rtx_fmt_e (code, mode, op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Likewise for ternary operations. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_gen_ternary (code, mode, op0_mode, op0, op1, op2)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode, op0_mode;
|
|
|
|
|
rtx op0, op1, op2;
|
|
|
|
|
{
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
/* If this simplifies, use it. */
|
|
|
|
|
if (0 != (tem = simplify_ternary_operation (code, mode, op0_mode,
|
|
|
|
|
op0, op1, op2)))
|
|
|
|
|
return tem;
|
|
|
|
|
|
|
|
|
|
return gen_rtx_fmt_eee (code, mode, op0, op1, op2);
|
|
|
|
|
}
|
|
|
|
|
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
/* Likewise, for relational operations.
|
|
|
|
|
CMP_MODE specifies mode comparison is done in.
|
|
|
|
|
*/
|
2001-02-13 21:43:13 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
simplify_gen_relational (code, mode, cmp_mode, op0, op1)
|
2001-02-13 21:43:13 +01:00
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
enum machine_mode cmp_mode;
|
2001-02-13 21:43:13 +01:00
|
|
|
|
rtx op0, op1;
|
|
|
|
|
{
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
if ((tem = simplify_relational_operation (code, cmp_mode, op0, op1)) != 0)
|
2001-02-13 21:43:13 +01:00
|
|
|
|
return tem;
|
|
|
|
|
|
|
|
|
|
/* Put complex operands first and constants second. */
|
2001-05-17 23:21:21 +02:00
|
|
|
|
if (swap_commutative_operands_p (op0, op1))
|
2001-02-13 21:43:13 +01:00
|
|
|
|
tem = op0, op0 = op1, op1 = tem, code = swap_condition (code);
|
|
|
|
|
|
|
|
|
|
return gen_rtx_fmt_ee (code, mode, op0, op1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Replace all occurrences of OLD in X with NEW and try to simplify the
|
|
|
|
|
resulting RTX. Return a new RTX which is as simplified as possible. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_replace_rtx (x, old, new)
|
|
|
|
|
rtx x;
|
|
|
|
|
rtx old;
|
|
|
|
|
rtx new;
|
|
|
|
|
{
|
|
|
|
|
enum rtx_code code = GET_CODE (x);
|
|
|
|
|
enum machine_mode mode = GET_MODE (x);
|
|
|
|
|
|
|
|
|
|
/* If X is OLD, return NEW. Otherwise, if this is an expression, try
|
|
|
|
|
to build a new expression substituting recursively. If we can't do
|
|
|
|
|
anything, return our input. */
|
|
|
|
|
|
|
|
|
|
if (x == old)
|
|
|
|
|
return new;
|
|
|
|
|
|
|
|
|
|
switch (GET_RTX_CLASS (code))
|
|
|
|
|
{
|
|
|
|
|
case '1':
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode op_mode = GET_MODE (XEXP (x, 0));
|
|
|
|
|
rtx op = (XEXP (x, 0) == old
|
|
|
|
|
? new : simplify_replace_rtx (XEXP (x, 0), old, new));
|
|
|
|
|
|
|
|
|
|
return simplify_gen_unary (code, mode, op, op_mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case '2':
|
|
|
|
|
case 'c':
|
|
|
|
|
return
|
|
|
|
|
simplify_gen_binary (code, mode,
|
|
|
|
|
simplify_replace_rtx (XEXP (x, 0), old, new),
|
|
|
|
|
simplify_replace_rtx (XEXP (x, 1), old, new));
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
case '<':
|
2001-07-20 00:42:07 +02:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode op_mode = (GET_MODE (XEXP (x, 0)) != VOIDmode
|
|
|
|
|
? GET_MODE (XEXP (x, 0))
|
|
|
|
|
: GET_MODE (XEXP (x, 1)));
|
|
|
|
|
rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
|
|
|
|
|
rtx op1 = simplify_replace_rtx (XEXP (x, 1), old, new);
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
simplify_gen_relational (code, mode,
|
|
|
|
|
(op_mode != VOIDmode
|
|
|
|
|
? op_mode
|
|
|
|
|
: GET_MODE (op0) != VOIDmode
|
|
|
|
|
? GET_MODE (op0)
|
|
|
|
|
: GET_MODE (op1)),
|
|
|
|
|
op0, op1);
|
|
|
|
|
}
|
2001-02-13 21:43:13 +01:00
|
|
|
|
|
|
|
|
|
case '3':
|
|
|
|
|
case 'b':
|
2001-07-20 00:42:07 +02:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode op_mode = GET_MODE (XEXP (x, 0));
|
|
|
|
|
rtx op0 = simplify_replace_rtx (XEXP (x, 0), old, new);
|
|
|
|
|
|
|
|
|
|
return
|
2002-05-09 14:02:29 +02:00
|
|
|
|
simplify_gen_ternary (code, mode,
|
2001-07-20 00:42:07 +02:00
|
|
|
|
(op_mode != VOIDmode
|
|
|
|
|
? op_mode
|
|
|
|
|
: GET_MODE (op0)),
|
|
|
|
|
op0,
|
|
|
|
|
simplify_replace_rtx (XEXP (x, 1), old, new),
|
|
|
|
|
simplify_replace_rtx (XEXP (x, 2), old, new));
|
|
|
|
|
}
|
2001-02-13 21:43:13 +01:00
|
|
|
|
|
|
|
|
|
case 'x':
|
2001-05-17 20:46:58 +02:00
|
|
|
|
/* The only case we try to handle is a SUBREG. */
|
|
|
|
|
if (code == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
rtx exp;
|
|
|
|
|
exp = simplify_gen_subreg (GET_MODE (x),
|
|
|
|
|
simplify_replace_rtx (SUBREG_REG (x),
|
|
|
|
|
old, new),
|
|
|
|
|
GET_MODE (SUBREG_REG (x)),
|
|
|
|
|
SUBREG_BYTE (x));
|
|
|
|
|
if (exp)
|
|
|
|
|
x = exp;
|
|
|
|
|
}
|
2001-02-13 21:43:13 +01:00
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
default:
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
if (GET_CODE (x) == MEM)
|
[multiple changes]
Mon Jul 9 06:41:07 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (adjust_address_nv, replace_equiv_address_nv): New fcns.
(operand_subword): Use them.
(change_address_1): Renamed from change_address; new arg VALIDATE.
* expr.h: Reflect above changes; change_address now macro.
* alias.c (canon_rtx): Use replace_equiv_address_nv instead of
making MEM.
* cselib.c (add_mem_for_addr): Likewise.
* expr.c (protect_from_queue, emit_move_insn_1): Likewise.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (eliminate_regs): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Likewise.
* caller-save.c (setup_save_areas): Use adjust_address_nv instead of
adjust_addess.
* combine.c (make_extraction, simplify_shift_const): Likewise.
(gen_lowpart_for_combine): Likewise.
* cse.c (gen_lowpart_if_possible): Likewise.
* function.c (fixup_var_refs_1, purge_addressof_1): Likewise.
* expr.c (expand_expr, case COMPONENT_REF): Likewise.
* optabs.c (gen_move_insn): Likewise.
* reload1.c (alter_reg): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_anon_union_decl): Likewise.
* recog.c (validate_replace_rtx_1): Likewise.
(expr.h): Include.
* Makefile.in (recog.o): Add $(EXPR_H).
* explow.c (stabilize): Call replace_equiv_address.
* expr.c (move_by_pieces_1, store_by_pieces_2): Likewise.
* final.c (alter_subreg): OFFSET is HOST_WIDE_INT.
2001-07-09 Bo Thorsen <bo@suse.co.uk>
* config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support.
2001-07-09 Neil Booth <neil@daikokuya.demon.co.uk>
* final.c (output_addr_const): Use target opening and
closing parentheses.
* target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN
defaults, add to TARGET_ASM_OUT.
* target.h (struct gcc_target): Add open_paren and close_paren.
* doc/md.texi: Update.
* doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE,
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and
TARGET_ASM_CLOSE_PAREN.
* config/i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN):
Override.
* config/pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN):
Override.
* config/1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove.
* config/a29k/a29k.h: Similarly.
* config/alpha/alpha.h: Similarly.
* config/arc/arc.h: Similarly.
* config/arm/aof.h: Similarly.
* config/arm/aout.h: Similarly.
* config/avr/avr.h: Similarly.
* config/c4x/c4x.h: Similarly.
* config/clipper/clipper.h: Similarly.
* config/convex/convex.h: Similarly.
* config/d30v/d30v.h: Similarly.
* config/dsp16xx/dsp16xx.h: Similarly.
* config/elxsi/elxsi.h: Similarly.
* config/fr30/fr30.h: Similarly.
* config/h8300/h8300.h: Similarly.
* config/i370/i370.h: Similarly.
* config/i386/i386.h: Similarly.
* config/i860/i860.h: Similarly.
* config/i960/i960.h: Similarly.
* config/ia64/ia64.h: Similarly.
* config/m32r/m32r.h: Similarly.
* config/m68hc11/m68hc11.h: Similarly.
* config/m68k/m68k.h: Similarly.
* config/m88k/m88k.h: Similarly.
* config/mcore/mcore.h: Similarly.
* config/mips/mips.h: Similarly.
* config/mn10200/mn10200.h: Similarly.
* config/mn10300/mn10300.h: Similarly.
* config/ns32k/ns32k.h: Similarly.
* config/pa/pa.h: Similarly.
* config/pdp11/pdp11.h: Similarly.
* config/pj/pj.h: Similarly.
* config/romp/romp.h: Similarly.
* config/rs6000/rs6000.h: Similarly.
* config/sh/sh.h: Similarly.
* config/sparc/sparc.h: Similarly.
* config/v850/v850.h: Similarly.
* config/vax/vax.h: Similarly.
* config/we32k/we32k.h: Similarly.
2001-07-09 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/c-tree.texi: Document representation of attributes.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/tm.texi: Update some places for the rename of target to
targetm. Fix typo.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* target.h (struct gcc_target): Add insert_attributes.
* target-def.h (TARGET_INSERT_ATTRIBUTES): Define.
(TARGET_INITIALIZER): Update.
* tree.c, tree.h (default_insert_attributes): New function.
Update comments on other default functions to refer to targetm,
not target.
* doc/tm.texi (INSERT_ATTRIBUTES): Update to document
TARGET_INSERT_ATTRIBUTES.
(SET_DEFAULT_DECL_ATTRIBUTES): Remove.
* c-common.c (decl_attributes): Use targetm.insert_attributes.
Don't use PRAGMA_INSERT_ATTRIBUTES.
* Makefile.in (c-common.o): Depend on $(TARGET_H).
* c-decl.c (start_decl, start_function): Don't call
SET_DEFAULT_DECL_ATTRIBUTES.
* config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define.
* config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't
declare.
* config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define.
(c4x_check_attribute): Avoid modifying attribute list itself.
(c4x_set_default_attributes): Rename to c4x_insert_attributes.
Make static.
* config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define.
* config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't
declare.
* config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define.
(sh_pragma_insert_attributes): Rename to sh_insert_attributes.
Make static.
* config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define.
* config/v850/v850-protos.h (v850_set_default_decl_attr): Don't
declare.
* config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define.
(v850_set_default_decl_attr): Rename to v850_insert_attributes.
Adjust parameters. Make static.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (decl_attributes): Only take a single attributes
parameter.
* c-common.h (decl_attributes): Update prototype.
* c-decl.c (start_decl, start_function): Only take a single
attributes parameter. Update calls to decl_attributes.
(finish_struct, finish_enum): Update calls to decl_attributes.
(push_parm_decl): Expect unified list of attributes. Update call
to decl_attributes.
* c-parse.in (fndef, initdcl, notype_initdcl, nested_function,
notype_nested_function, component_declarator,
component_notype_declarator, label): Update calls to
decl_attributes.
(absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute
lists that are passed to push_parm_decl.
* c-tree.h (start_function, start_decl): Update prototypes.
* config/sh/sh-protos.h, config/sh/sh.c
(sh_pragma_insert_attributes): Only take a single attributes
parameter.
* config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise.
* doc/tm.texi (INSERT_ATTRIBUTES): Update.
* objc/objc-act.c (define_decl, generate_objc_symtab_decl,
build_module_descriptor, generate_static_references,
generate_strings, build_selector_translation_table,
generate_descriptor_table, generate_protocols,
generate_ivars_list, generate_dispatch_table,
generate_protocol_list, generate_category,
generate_shared_structures, really_start_method, add_objc_decls,
generate_classref_translation_entry): Update calls to start_decl
and start_function.
(build_tmp_function_decl, start_method_def): Unify attribute lists
that are passed to push_parm_decl.
2001-07-08 Neil Booth <neil@daikokuya.demon.co.uk>
* final.c (no_asm_to_stream): New.
(final_scan_insn): Use target structures for prologue ends
and epilogue starts.
* output.h (no_asm_to_stream): New.
* target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE,
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New.
(TARGET_ASM_OUT): Update.
* target.h (struct gcc_target): New members function_end_prologue
and function_begin_epilogue.
* config/1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused.
* config/alpha/alpha-protos.h (output_end_prologue): Delete.
* config/alpha/alpha.c (output_end_prologue): Rename to
alpha_output_function_end_prologue. Use in target struct
and make static.
* config/alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete.
* config/ia64/ia64-protos.h (ia64_output_end_prologue): Delete.
* config/ia64/ia64.c (ia64_output_end_prologue): Rename to
ia64_output_function_end_prologue. Use in target struct
and make static.
(ia64_function_prologue, ia64_funciton_epilogue): Rename
mistyped prototypes.
* config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete.
* config/m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue):
Delete.
* config/m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename
an use in target struct, make static.
* config/ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE):
Delete.
2001-07-08 Richard Henderson <rth@redhat.com>
* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
2001-07-08 Richard Henderson <rth@redhat.com>
* config/i386/i386.md: Remove constraints strings from define_split
and define_peephole2 patterns.
(eh_return_si, eh_return_di): Split eh_return_1 for modes.
(eh_return): Use them.
2001-07-08 Richard Henderson <rth@redhat.com>
* doc/tm.texi (Exception Handling): New subnode of Stack and Calling.
Document MD_FALLBACK_FRAME_STATE_FOR.
2001-07-07 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset):
Take into account m68hc11_sp_correction for FRAME_POINTER_REGNUM
elimination.
* config/m68hc11/m68hc11.h (STARTING_FRAME_OFFSET): Use 0.
2001-07-07 Nick Clifton <nickc@cambridge.redhat.com>
* config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Append # to end
of the label inside NAME as opposed to just the end of NAME.
2001-07-07 Neil Booth <neil@daikokuya.demon.co.uk>
* config/alpha/alpha-protos.h (vms_valid_decl_attribute_p): Delete.
* config/alpha/alpha.c (alpha_init_machine_status,
alpha_mark_machine_status, alpha_free_machine_status): Delete.
(TARGET_VALID_DECL_ATTRIBUTE): Define for VMS.
(vms_valid_decl_attribute_p): Make static, conditionally compile.
* config/alpha/alpha.h (VALID_MACHINE_DECL_ATTRIBUTE): Delete.
2001-07-06 Stan Shebs <shebs@apple.com>
* target.h (targetm): Rename global from "target", so as not to
conflict with local variables.
* c-decl.c: Ditto.
* c-typeck.c: Ditto.
* final.c: Ditto.
* tree.c: Ditto.
* cp/decl.c: Ditto.
* cp/decl2.c: Ditto.
* cp/typeck.c: Ditto.
* 1750a/1750a.c: Ditto.
* a29k/a29k.c: Ditto.
* arc/arc.c: Ditto.
* arm/arm.c: Ditto.
* avr/avr.c: Ditto.
* clipper/clipper.c: Ditto.
* convex/convex.c: Ditto.
* d30v/d30v.c: Ditto.
* dsp16xx/dsp16xx.c: Ditto.
* elxsi/elxsi.c: Ditto.
* fr30/fr30.c: Ditto.
* h8300/h8300.c: Ditto.
* i370/i370.c: Ditto.
* i386/i386.c: Ditto.
* i860/i860.c: Ditto.
* i960/i960.c: Ditto.
* ia64/ia64.c: Ditto.
* m32r/m32r.c: Ditto.
* m68hc11/m68hc11.c: Ditto.
* m68k/m68k.c: Ditto.
* m88k/m88k.c: Ditto.
* mips/mips.c: Ditto.
* ns32k/ns32k.c: Ditto.
* pa/pa.c: Ditto.
* pdp11/pdp11.c: Ditto.
* romp/romp.c: Ditto.
* rs6000/rs6000.c: Ditto.
* sh/sh.c: Ditto.
* sparc/sparc.c: Ditto.
* vax/vax.c: Ditto.
* we32k/we32k.c: Ditto.
* doc/tm.texi: Update the manual to match.
2001-07-06 Richard Henderson <rth@redhat.com>
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of
DWARF2_UNWIND_INFO not just whether it is defined.
2001-07-06 Diego Novillo <dnovillo@redhat.com>
* combine.c (combine_simplify_rtx): Also recompute 'mode' if the
call to simplify_binary_operation returns a new pattern.
2001-07-06 Roman Lechtchinsky <rl@cs.tu-berlin.de>
* glimits.h (__SHRT_MAX__): New.
(SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX.
(SHRT_MAX): Define in terms of __SHRT_MAX__.
2001-07-06 Jan van Male <jan.vanmale@fenk.wau.nl>
* alias.c (base_alias_check): Cast GET_MODE_UNIT_SIZE to int to
avoid warnings.
2001-07-06 Richard Henderson <rth@redhat.com>
* bitmap.c (bitmap_release_memory): Move adjacent to the
allocation functions.
(bitmap_first_set_bit, bitmap_last_set_bit): Streamline knowing
the implementation. Binary search for the set bit.
(bitmap_union_of_diff): Allocate the temporary on the stack
instead of using xmalloc.
2001-07-06 Richard Henderson <rth@redhat.com>
* genrecog.c (validate_pattern): Warn for constraints in
define_{expand,split,peephole2}. Remove strict_low_part
before looking up match_dup.
2001-07-06 DJ Delorie <dj@redhat.com>
* doc/gcc.texi (Makefile): Rename to be a more general purpose
chapter about various build hints and history. Add section
talking about the various types of native and cross builds.
2001-07-06 Neil Booth <neil@daikokuya.demon.co.uk>
* Makefile.in (final.o): Depend on target.h.
* final.c: Include target.h.
(default_function_pro_epilogue): New.
(final_start_function): Use target structure for function prologues.
(final_end_function): Use target structure for function epilogues.
* fold-const.c (real_hex_to_f): Constify s and p.
* output.h (default_function_pro_epilogue): New.
* real.h (real_hex_to_f): Update prototype.
* target-def.h (TARGET_ASM_FUNCTION_PROLOGUE,
TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New.
(TARGET_INITIALIZER): Update.
* target.h (gcc_target): Add struct asm_out.
* doc/tm.texi: Update.
config:
Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and
TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions
in cpu/cpu.c, or rename old functions consistently. Take
a HOST_WIDE INT not an int as the SIZE parameter. Remove now
redundant macros and prototypes. Make new functions static.
* 1750a/1750a.c: Similarly.
* 1750a/1750a.h: Similarly.
* a29k/a29k-protos.h: Similarly.
* a29k/a29k.c: Similarly.
* a29k/a29k.h: Similarly.
* arc/arc-protos.h: Similarly.
* arc/arc.c: Similarly.
* arc/arc.h: Similarly.
* arm/arm-protos.h: Similarly.
* arm/arm.c: Similarly.
* arm/arm.h: Similarly.
* avr/avr-protos.h: Similarly.
* avr/avr.c: Similarly.
* avr/avr.h: Similarly.
* clipper/clipper-protos.h: Similarly.
* clipper/clipper.c: Similarly.
* clipper/clipper.h: Similarly.
* convex/convex.c: Similarly.
* convex/convex.h: Similarly.
* d30v/d30v-protos.h: Similarly.
* d30v/d30v.c: Similarly.
* d30v/d30v.h: Similarly.
* d30v/d30v.md: Similarly.
* dsp16xx/dsp16xx-protos.h: Similarly.
* dsp16xx/dsp16xx.c: Similarly.
* dsp16xx/dsp16xx.h: Similarly.
* elxsi/elxsi.c: Similarly.
* elxsi/elxsi.h: Similarly.
* fr30/fr30.c: Similarly.
* fr30/fr30.md: Similarly.
* h8300/h8300-protos.h: Similarly.
* h8300/h8300.c: Similarly.
* h8300/h8300.h: Similarly.
* i370/i370-protos.h: Similarly.
* i370/i370.c: Similarly.
* i370/i370.h: Similarly.
* i386/i386.c: Similarly.
* i386/osf1elf.h: Similarly.
* i386/osfrose.h: Similarly.
* i860/i860-protos.h: Similarly.
* i860/i860.c: Similarly.
* i860/i860.h: Similarly.
* i960/i960-protos.h: Similarly.
* i960/i960.c: Similarly.
* i960/i960.h: Similarly.
* ia64/ia64-protos.h: Similarly.
* ia64/ia64.c: Similarly.
* ia64/ia64.h: Similarly.
* m32r/m32r-protos.h: Similarly.
* m32r/m32r.c: Similarly.
* m32r/m32r.h: Similarly.
* m68hc11/m68hc11-protos.h: Similarly.
* m68hc11/m68hc11.c: Similarly.
* m68hc11/m68hc11.h: Similarly.
* m68k/crds.h: Similarly.
* m68k/dpx2.h: Similarly.
* m68k/m68k-protos.h: Similarly.
* m68k/m68k.c: Similarly.
* m68k/m68k.h: Similarly.
* m68k/news.h: Similarly.
* m88k/m88k-protos.h: Similarly.
* m88k/m88k.c: Similarly.
* m88k/m88k.h: Similarly.
* mips/mips-protos.h: Similarly.
* mips/mips.c: Similarly.
* mips/mips.h: Similarly.
* ns32k/merlin.h: Similarly.
* ns32k/ns32k.c: Similarly.
* ns32k/ns32k.h: Similarly.
* ns32k/tek6000.h: Similarly.
* pa/pa-protos.h: Similarly.
* pa/pa.c: Similarly.
* pa/pa.h: Similarly.
* pdp11/2bsd.h: Similarly.
* pdp11/pdp11-protos.h: Similarly.
* pdp11/pdp11.c: Similarly.
* pdp11/pdp11.h: Similarly.
* romp/romp-protos.h: Similarly.
* romp/romp.c: Similarly.
* romp/romp.h: Similarly.
* rs6000/rs6000-protos.h: Similarly.
* rs6000/rs6000.c: Similarly.
* rs6000/rs6000.h: Similarly.
* rs6000/sysv4.h: Similarly.
* sh/sh-protos.h: Similarly.
* sh/sh.c: Similarly.
* sh/sh.h: Similarly.
* sparc/sparc-protos.h: Similarly.
* sparc/sparc.c: Similarly.
* sparc/sparc.h: Similarly.
* vax/vax.c: Similarly.
* vax/vax.h: Similarly.
* vax/vms.h: Similarly.
* we32k/we32k.c: Similarly.
* we32k/we32k.h: Similarly.
Fri Jul 6 11:47:59 2001 Jeffrey A Law (law@cygnus.com)
* basic-block.h (first_insn_after_basic_block_note): Declare.
* flow.c (first_insn_after_basic_block_note): Define. Moved
from...
* ssa.c (first_insn_after_basic_block_note): Remove.
* ssa-dce.c (find_inherently_necessary): Consider BARRIERs
necessary.
(ssa_eliminate_dead_code): Properly update the CFG and PHI
nodes when we find a dead conditional branch. Insert BARRIERs
after any blocks with no successors, but which do not have
any BARRIERs.
2001-07-06 Zack Weinberg <zackw@stanford.edu>
* varray.c (varray_check_failed): Use internal_error.
2001-07-05 Andrew Haley <aph@redhat.com>
* Makefile.in (LIB2_DIVMOD_FUNCS): New.
(LIB2FUNCS): Move divmod functions to LIB2_DIVMOD_FUNCS.
* mklibgcc.in: Compile LIB2_DIVMOD_FUNCS.
2001-07-02 Jason Merrill <jason_merrill@redhat.com>
* dwarf2out.c (mem_loc_descriptor): Only look through a constant pool
reference if the target constant is also a SYMBOL_REF.
2001-07-05 Eric Christopher <echristo@redhat.com>
* config/mips/mips.h (MASK_MIPS3900): Remove.
(MASK_MIPS16,MASK_NO_CHECK_ZERO_DIV,MASK_CHECK_RANGE_DIV,
MASK_UNINIT_CONST_IN_RODATA): Change for 3900 mask removal.
(TARGET_MIPS3900): Change to use mips_arch.
(TARGET_MIPS4000): New.
(TARGET_MIPS4100): New.
(TARGET_MIPS4300): New.
(TARGET_SWITCHES): Change 3900 and 4650 options to NULL.
(SUBTARGET_TARGET_OPTIONS): Add -march. Change help text
for -mipsX.
(GENERATE_BRANCHLIKELY): Move TARGET_MIPS3900.
(ISA_HAS_BRANCHLIKELY): To here.
(CC1_CPU_SPEC): New.
(CC1_SPEC): Use here. Remove 4650 and 3900 options.
(mips_arch_string): Declare.
(mips_arch): Declare.
(TARGET_OPTIONS): Add -march and -mtune.
* config/mips/mips.c (mips_arch_string): New.
(mips_arch): New.
(override_options): Handle -march for codegen and -mtune
for scheduling. Use mips_arch. Move tx39 target default here.
(mips_parse_cpu): Move error message to override_options.
* config/mips/r3900.h (TARGET_DEFAULT): Remove.
* config/mips/mips.md: Use TARGET_MIPS4000 and TARGET_MIPS4300.
* doc/invoke.texi (Option Summary): Add -march and -mtune entries.
(MIPS Options): Ditto. Change mcpu entry to historical text.
2001-07-05 H.J. Lu (hjl@gnu.org)
* config/mips/mips.c (mips_parse_cpu): New function to parse
-march=*/-mcpu=*.
2001-07-05 Jim Wilson <wilson@redhat.com>
* config/ia64/lib1funcs.asm: Revert 2001-07-02 change.
* config/ia64/t-ia64: Likewise.
(LIB1ASMFUNCS): Update comment.
2001-07-05 David Edelsohn <edelsohn@gnu.org>
* doc/install.texi (Install GCC: Binaries): Fix typo.
2001-07-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory
reference using the stack pointer, adjust it since we push Y
temporarily.
("*ashrsi3"): Likewise.
("*lshrsi3"): Likewise.
2001-07-05 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address
when -fomit-frame-pointer is used.
2001-07-05 Jeffrey Oldham <oldham@codesourcery.com>
* flow.c: Reverse Jan Hubicka's patch of 02July2001.
(try_redirect_by_replacing_jump): Reverse updating properly the
count and frequency information. Reverse removing cc0 setter.
(forwarder_block_p): Reverse fixing for fallthru blocks.
2001-07-05 DJ Delorie <dj@redhat.com>
* gcc.c (TARGET_OPTION_TRANSLATE_TABLE): New.
(translate_options): If the above is defined, use it to map
given options to new options.
* doc/tm.texi: Document it.
2001-07-05 Brad Lucier <lucier@math.purdue.edu>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/invoke.texi (Optimize Options): Document that -fgcse may
cause programs using computed gotos to run more slowly.
2001-07-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi (Specific): Markup, spelling and typo fixes.
Fixed sorting.
Consistently require binutils 2.11.2, not prereleases.
(Specific, decstation-*): Canonicalize as mips-dec-*.
(Specific, i?86-*-sco3.2v5*): Remove make bootstrap requirement,
always necessary.
(Specific, m68k-altos): Removed reference to README.altos, deleted.
(Specific, mips-*): Reword MIPS C compiler requirements.
(Specific, powerpc*-*-*): New, mention --with-cpu once.
(Specific, sunv5): Removed, obsolete.
2001-07-05 Nathan Sidwell <nathan@codesourcery.com>
* dwarf2out.c (output_loc_list): Use an all ones mask for
.text asm output and don't rely on long long
literals. Reformat some long lines.
2001-07-05 Andreas Jaeger <aj@suse.de>
* doc/gcc.texi (GNU/Linux): Remove accidental re-add of GPL
section.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* dwarf2out.c (dwarf2out_define): Update comment.
(dwarf2out_undef): Ditto.
(dwarf2out_start_source_file): Ditto.
(dwarf2out_end_source_file): Ditto.
(dwarf2out_finish): Output DW_MACINFO_end_file for primary file,
since we never call the start/end debug hook for the primary file.
2001-07-04 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c (get_shift_alg): Remove an extra operand
from shll.
2001-07-04 Nathan Sidwell <nathan@codesourcery.com>
* cppinit.c (remove_dup_dirs): Inform if a system include
directory is being reordered.
* doc/invoke.texi (Directory Options): GCC warns if you hide a
system include.
* doc/cpp.texi (Search Paths): Likewise.
* doc/gcc.texi (Interoperation): Remove information about
-I/usr/include.
2001-07-04 Nathan Sidwell <nathan@codesourcery.com>
* varray.h (VARRAY_TOP_GENERIC_PTR): Remove spurious parameter.
(VARRAY_TOP_CHAR_PTR): Likewise.
2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c (process_command): Don't assign elements of a const char*.
Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (change_address): Don't abort if invalid address while
reload is in progress.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* c-lex.c (cb_file_change): Pass line number to
debug_start_source_file.
(cb_undefine): Pass correct line number to debug_undef.
* toplev.c (debug_start_source_file): Add line number to
parameters. Pass it along to dwarf2out_start_source_file.
(decode_g_option): Stop resetting debug level back to normal when
we change debug formats, unless the current level is
none. (Before, -g3 -gdwarf-2 would use debug level 2, rather than
3).
* toplev.h (debug_start_source_file): Add line number to
parameters.
* dwarf2out.h (dwarf2out_start_source_file): Add line number to
parameters.
* dwarf2out.c (dwarf2out_start_source_file): Add line number to
parameters.
Output debug_macinfo data for starting file if requested.
(dwarf2out_end_source_file): Output debug_macinfo data for ending
file if requested.
(dwarf2out_define): Output debug_macinfo data for defining a macro
if requested.
(dwarf2out_undef): Output debug_macinfo data for undefining a
macro if requested.
(DEBUG_MACINFO_SECTION): New. DWARF2 macro info section name.
(DEBUG_MACINFO_SECTION_LABEL): New. DWARF2 macro info section label.
(macinfo_section_label): New. DWARF2 macro info section label.
(dwarf2out_init): If we want macro info, output the start label
for the section.
(dwarf2out_finish): If we want macro info, add a DW_AT_macro_info
attribute to the compilation unit die pointing to the macro info.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* dwarf2out.c (new_loc_list): Move to inside #ifdef
DWARF2_DEBUGGING_INFO.
(add_loc_descr_to_loc_list): Ditto.
(output_loc_list): Ditto.
Also, fix thinko in curr not being initialized.
(gen_internal_sym): Ditto.
Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (replace_equiv_address): New function.
* expr.h (replace_equiv_address): New declaration.
* explow.c (validize_mem): Call it instead of change_address and
also call if -fforce-addr and address is constant.
* expr.c: Replace more calls to change_address with adjust_address
and/or replace_equiv_address or to validize_mem.
* function.c, regmove.c, config/alpha/alpha.c: Likewise.
* config/arm/arm.md, config/clipper/clipper.md: Likewise.
* config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise.
* config/i370/i370.md, config/i860/i860.md: Likewise.
* config/i960/i960.md, config/mips/mips.c: Likewise.
* config/mips/mips.md, config/pa/pa.md: Likewise.
* config/pdp11/pdp11.md, config/rs6000/rs6000.c: Likewise.
* config/rs6000/rs6000.md, config/sh/sh.md: Likewise.
2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA.
* bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a
function.
2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/include: New directory.
* doc/fdl.texi: Move to doc/include/fdl.texi.
* doc/texinfo.tex: Move to doc/include/texinfo.tex.
* doc/include/funding.texi, doc/include/gpl.texi: New files.
* doc/gcc.texi: Use funding.texi and gpl.texi.
* Makefile.in ($(docdir)/cpp.info, $(docdir)/gcc.info,
$(docdir)/cppinternals.info, cpp.dvi. gcc.dvi. cppinternals.dvi):
Update dependencies and use -I $(docdir)/include.
2001-07-04 Anthony Green <green@redhat.com>
* config/v850/t-v850 (v850-c.o): Add missing dependencies.
2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi (sparc64-*-*): Remove garbage.
Wed Jul 4 09:07:44 2001 Jan van Male <jan.vanmale@fenk.wau.nl>
* i386.c (ix86_expand_builtin, case IX86_BUILTIN_SETPS):
Fix typo in last change to use adjust_address.
2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi (Specific): Update information for *-*-solaris*.
Tue Jul 3 22:33:15 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide): Reinitialize Y for restart.
2001-07-03 Stan Shebs <shebs@apple.com>
* config/darwin.h (SECTION_FUNCTION): Remove WAS_TEXT argument, remove
case for flag_no_mach_text_sections.
(EXTRA_SECTION_FUNCTIONS): Remove arg from uses of SECTION_FUNCTION.
* config/darwin.c (flag_no_mach_text_sections): Remove.
* config/darwin-protos.h (darwin_init_pragma): Remove decl.
Tue Jul 3 15:35:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide, case PLUS): Call find_constant_term
and avoid checking for constant as first operand.
* recog.c (find_constant_term_loc): No longer static.
(adj_offettable_operand): Delete.
* rtl.h (adj_offsettable_operand): Delete declaration.
(find_constant_term): Add declaration.
* caller-save.c: Replace calls to adj_offsettable_operand with calls
to adjust_address.
* config/arm/arm.c, config/c4x/c4x.c: Likewise.
* config/clipper/clipper.md, config/h8300/h8300.c: Likewise.
* config/i386/i386.c, config/i386/i386.md: Likewise.
* config/i860/i860.c, config/i960/i960.c: Likewise.
* config/i960/i960.md, config/m68hc11/m68hc11.c: Likewise.
* config/m68k/m68k.c, config/m68k/m68k.md: Likewise.
* config/m88k/m88k.md, config/mcore/mcore.c: Likewise.
* config/mips/mips.c, config/mips/mips.md: Likewise.
* config/mn10200/mn10200.c, config/mn10300/mn10300.c: Likewise.
* config/ns32k/ns32k.c, config/ns32k/ns32k.md: Likewise.
* config/pa/pa.c, config/pdp11/pdp11.c: Likewise.
* config/pdp11/pdp11.md, config/sh/sh.c, config/v850/v850.c: Likewise.
* config/vax/vax.md, config/ns32k/ns32k.c: Likewise.
* config/ns32k/ns32k.md: Likewise.
2001-07-03 Zack Weinberg <zackw@stanford.edu>
* rtl.c (copy_rtx): Handle 'T' format letter.
* gensupport.c (collect_insn_data): Likewise.
* print-rtl.c (print_rtx): Print 'T' slots like 's'.
2001-07-03 Nick Clifton <nickc@cambridge.redhat.com>
* doc/invoke.texi (Directory Options): Specifiy range for <N> in
-B option. Use 'dir' not 'foo' as example directory name.
2001-07-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
Fixes PRs bootstrap/3067, bootstrap/3249, bootstrap/3275.
2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/cppinternals.texi: Improve formatting and logical markup.
2001-07-03 Andreas Jaeger <aj@suse.de>
* Makefile.in (insn-recog.o): Add dependency on reload.h.
* genrecog.c (write_header): Include reload.h for prototypes in
insn-recog.c.
2001-07-03 Neil Booth <neil@daikokuya.demon.co.uk>
config:
* i386/cygwin.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* i386/i386-protos.h (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Add.
* i386/i386.c (TARGET_INITIALIZER): Override for cygwin targets.
* i386/winnt.c (i386_valid_decl_attribute_p): Return directly.
Mon Jul 2 21:52:19 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide, case LO_SUM): New case.
(plus_constant_for_output_wide): Delete.
* rtl.h (plus_constant_for_output): Delete.
* alias.c (canon_rtx, init_alias_analysis): Call plus_constant
instead of plus_constant_for_output.
* recog.c (offsettable_address_p, adj_offsettable_operand): Likewise.
* config/darwin.c, config/arm/arm.c, config/m68k/m68k.c: Likewise.
* config/m88k/m88k.c, config/mips/mips.c, config/pa/pa.c: Likewise.
* config/rs6000/rs6000.c, config/sparc/sparc.c: Likewise.
* config/sparc/sparc.md: Likewise.
Convert some change_address calls to adjust_address.
2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi,
doc/rtl.texi, doc/tm.texi: Improve formatting. Improve
documentation of -std and -Wwrite-strings.
2001-07-02 Geoffrey Keating <geoffk@redhat.com>
* cse.c (canon_hash): Don't register registers in very small
register classes, as extending their lifetime might cause
reload to fail.
Mon Jul 2 23:14:00 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_redirect_by_replacing_jump): Remove cc0 setter.
* flow.c (forwarder_block_p): Fix for fallthru blocks.
(try_redirect_by_replacing_jump): Update properly the count
and frequency information.
Mon Jul 2 14:20:13 2001 Jeffrey A Law (law@cygnus.com)
* toplev.c (dump_file_index): Move SSA dumps just after first
jump dump.
(dump_file): Corresponding changes.
(rest_of_compilation): Move SSA path to just after the first
jump pass.
* doc/gcc.texi (Passes): Update due to movement of SSA path.
* doc/invoke.texi: Update dump file #s as they were completely
out of date with reality.
2001-07-02 Geoffrey Keating <geoffk@redhat.com>
* doc/tm.texi (Frame Layout): Document STACK_PUSH_CODE.
* expr.c (emit_move_insn_1): Deal with non-default
STACK_PUSH_CODE.
* expr.c (emit_single_push_insn): Fix warning.
2001-07-02 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
* expr.c (emit_move_insn_1): Avoid modifying
cfun->expr->x_stack_pointer when PUSH_ROUNDING is defined.
Mon Jul 2 15:33:31 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (adjust_address): New function.
* expr.h (adjust_address): Add declaration.
* builtins.c: Replace some calls to change_address with calls to it
or to validize_mem.
* caller-save.c, dwarf2out.c, except.c, expmed.c, expr.c: Likewise.
* function.c, config/a29k/a29k.md, config/alpha/alpha.c: Likewise.
* config/arm/arm.c, config/convex/convex.c: Likewise.
* config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise.
* config/i386/i386.c, config/i386/i386.md: Likewise.
* config/ia64/ia64.c, config/ia64/ia64.md: Likewise.
* config/m32r/m32r.c, config/m68k/m68k.md: Likewise.
* config/m88k/m88k.c, config/mips/mips.md: Likewise.
* config/ns32k/ns32k.c, config/rs6000/rs6000.c: Likewise.
* config/sh/sh.c, config/sparc/sparc.md: Likewise.
2001-07-02 Jim Wilson <wilson@redhat.com>
* config/ia64/ia64.h: Delete obsolete lib1funcs.asm comment.
2001-07-02 Steve Ellcey <sje@cup.hp.com>
* config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore.
* config/ia64/lib1funcs.asm: Change macro names to match t-ia64.
2001-07-02 Zack Weinberg <zackw@stanford.edu>
* cppinit.c (lang_defaults): New table.
(set_lang): Just read from lang_defaults into the live options
structure.
2001-07-02 Zack Weinberg <zackw@stanford.edu>
* Makefile.in (doc): Depend on $(GENERATED_MANPAGES).
* doc/.cvsignore: Add gcc.1, cpp.1, gcov.1.
* doc/gcc.1, doc/cpp.1, doc/gcov.1: Removed.
2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi: Various spelling and markup fixes.
(Installing GCC): Component specific installation instructions are
gone.
Fix reference.
Warn about removing old install dir in the presence of shared libs.
(Configuration): Invoke with options target to match configure
--help.
Consistently refer to gas, gld pathnames.
Invert --enable-multilib documentation.
Remove references to old compiler versions.
Mon Jul 2 12:50:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* flow.c (try_simplify_condjump): Fix typo in updating fallthru flags.
2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi (Specific, mips*-sgi-irix4): Split from IRIX 5
section.
(Specific, mips*-sgi-irix5): Note IDO download.
Reworded MIPS C hints.
Use GNU as instead of GAS.
Markup fixes.
Removed SGI Freeware reference, IRIX 6 only.
(Specific, mips*-sgi-irix6): Removed ranlib caveats, obsolete.
Note N64 library requirement/workaround.
Update O32 hints.
Complete list of structure passing bug victims.
2001-07-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi: Remove CVS Id.
2001-07-02 Andreas Jaeger <aj@suse.de>
* ssa-dce.c (note_inherently_necessary_set): Add unused attribute.
(find_inherently_necessary): Remove unused variable.
2001-07-02 Nathan Sidwell <nathan@codesourcery.com>
* c-common.h (TDI_inlined): New ast dump phase.
(dump_flag_name): New function.
* c-dump.c (dump_files): Add inlined phase.
(dump_flag_name): Define.
* doc/invoke.texi (-fdump-ast-inlined): Document.
Mon Jul 2 06:29:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c (layout_decl): Revert change to handling of alignment
in packed types.
Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-common.c (decl_attributes, case A_MODE): Don't call layout_decl
for FIELD_DECL.
2001-07-01 Geoffrey Keating <geoffk@redhat.com>
* doc/tm.texi (FUNCTION_ARG): Document that the last call
is special.
2001-07-01 Nathan Sidwell <nathan@codesourcery.com>
* tlink.c (recompile_files): Remove COMPILER_PATH and
LIBRARY_PATH from the environment.
2001-07-01 Zack Weinberg <zackw@stanford.edu>
* c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT,
RID_LAST_PQ. Move RID_FIRST_PQ down with the other FIRST/LAST
enumerators.
(OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros.
* c-parse.in (OBJC_STRING): Kill.
(objc_string): Decompose to [objc_string] '@' STRING.
(reswords): Take the leading '@' off all the Objective C keywords.
(objc_rid_sans_at): Kill.
(init_reswords): Don't initialize it.
(yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD.
(_yylex): Kill reconsider label. Look ahead one token after
an '@'; if we get an identifier, check whether it's an
Objective C @-keyword. If so, return the keyword. Otherwise,
put back the token and return the '@' as a terminal.
* cpplib.c (lex_macro_node): Remove unnecessary check for
leading '@' on identifier. Clarify control flow and commentary.
Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cse.c (new_label_ref): Variable deleted.
(insert): Remove set of new_label_ref.
(check_for_label_ref): New function.
(cse_basic_block): Don't check new_label_ref; call check_for_label_ref.
See ChangeLog.5 for earlier changes.
From-SVN: r43861
2001-07-09 13:20:51 +02:00
|
|
|
|
return
|
|
|
|
|
replace_equiv_address_nv (x,
|
|
|
|
|
simplify_replace_rtx (XEXP (x, 0),
|
|
|
|
|
old, new));
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
|
2001-02-13 21:43:13 +01:00
|
|
|
|
return x;
|
|
|
|
|
}
|
rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* rtl.h (simplify_gen_relational): Add cmp_mode parameter.
* simplify-rtx.c (simplify_gen_relational): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Handle relationals and MEMs.
* i386.h (VALID_SSE_REG_MODE): Accept MMX modes if SSE2
* i386.md (movsi_1, movdi2, movdi_1_rex64): Handle SSE2 moves.
* i386.md (negsf2, negdf2, abssf2, absdf2): Force operands to
registers in SSE case; fix handling of the immediates.
(negsf2_ifs, abssf2_ifs): Tweak constraints; require
operands to be in regsiters before reload.
(negdf2_ifs, absdf2_ifs): Likewise; disable for 64bit
(negdf2_ifs_rex64, absdf2_ifs_rtx64): New.
(abstf,absxf,negtf,negxf splitters): Compute
properly the regnum for x86_64.
(avsdf2_if_rex64): New.
From-SVN: r41664
2001-04-28 21:16:30 +02:00
|
|
|
|
return x;
|
2001-02-13 21:43:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* Try to simplify a unary operation CODE whose output mode is to be
|
|
|
|
|
MODE with input operand OP whose mode was originally OP_MODE.
|
|
|
|
|
Return zero if no simplification can be made. */
|
|
|
|
|
rtx
|
|
|
|
|
simplify_unary_operation (code, mode, op, op_mode)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op;
|
|
|
|
|
enum machine_mode op_mode;
|
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int width = GET_MODE_BITSIZE (mode);
|
2001-07-17 17:11:56 +02:00
|
|
|
|
rtx trueop = avoid_constant_pool_reference (op);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* The order of these tests is critical so that, for example, we don't
|
|
|
|
|
check the wrong mode (input vs. output) for a conversion operation,
|
|
|
|
|
such as FIX. At some point, this should be simplified. */
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (code == FLOAT && GET_MODE (trueop) == VOIDmode
|
|
|
|
|
&& (GET_CODE (trueop) == CONST_DOUBLE || GET_CODE (trueop) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT hv, lv;
|
|
|
|
|
REAL_VALUE_TYPE d;
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop) == CONST_INT)
|
|
|
|
|
lv = INTVAL (trueop), hv = HWI_SIGN_EXTEND (lv);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
else
|
2001-07-17 17:11:56 +02:00
|
|
|
|
lv = CONST_DOUBLE_LOW (trueop), hv = CONST_DOUBLE_HIGH (trueop);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_INT (d, lv, hv, mode);
|
|
|
|
|
d = real_value_truncate (mode, d);
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
|
|
|
|
|
}
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (code == UNSIGNED_FLOAT && GET_MODE (trueop) == VOIDmode
|
|
|
|
|
&& (GET_CODE (trueop) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT hv, lv;
|
|
|
|
|
REAL_VALUE_TYPE d;
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop) == CONST_INT)
|
|
|
|
|
lv = INTVAL (trueop), hv = HWI_SIGN_EXTEND (lv);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
else
|
2001-07-17 17:11:56 +02:00
|
|
|
|
lv = CONST_DOUBLE_LOW (trueop), hv = CONST_DOUBLE_HIGH (trueop);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
if (op_mode == VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
/* We don't know how to interpret negative-looking numbers in
|
|
|
|
|
this case, so don't try to fold those. */
|
|
|
|
|
if (hv < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_MODE_BITSIZE (op_mode) >= HOST_BITS_PER_WIDE_INT * 2)
|
|
|
|
|
;
|
|
|
|
|
else
|
|
|
|
|
hv = 0, lv &= GET_MODE_MASK (op_mode);
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_UNSIGNED_INT (d, lv, hv, mode);
|
|
|
|
|
d = real_value_truncate (mode, d);
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop) == CONST_INT
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& width <= HOST_BITS_PER_WIDE_INT && width > 0)
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
HOST_WIDE_INT arg0 = INTVAL (trueop);
|
|
|
|
|
HOST_WIDE_INT val;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case NOT:
|
|
|
|
|
val = ~ arg0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NEG:
|
|
|
|
|
val = - arg0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ABS:
|
|
|
|
|
val = (arg0 >= 0 ? arg0 : - arg0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FFS:
|
|
|
|
|
/* Don't use ffs here. Instead, get low order bit and then its
|
|
|
|
|
number. If arg0 is zero, this will return 0, as desired. */
|
|
|
|
|
arg0 &= GET_MODE_MASK (mode);
|
|
|
|
|
val = exact_log2 (arg0 & (- arg0)) + 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TRUNCATE:
|
|
|
|
|
val = arg0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ZERO_EXTEND:
|
2002-02-21 00:15:00 +01:00
|
|
|
|
/* When zero-extending a CONST_INT, we need to know its
|
|
|
|
|
original mode. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (op_mode == VOIDmode)
|
2002-02-21 00:15:00 +01:00
|
|
|
|
abort ();
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (GET_MODE_BITSIZE (op_mode) == HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
/* If we were really extending the mode,
|
|
|
|
|
we would have to distinguish between zero-extension
|
|
|
|
|
and sign-extension. */
|
|
|
|
|
if (width != GET_MODE_BITSIZE (op_mode))
|
|
|
|
|
abort ();
|
|
|
|
|
val = arg0;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_MODE_BITSIZE (op_mode) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
val = arg0 & ~((HOST_WIDE_INT) (-1) << GET_MODE_BITSIZE (op_mode));
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGN_EXTEND:
|
|
|
|
|
if (op_mode == VOIDmode)
|
|
|
|
|
op_mode = mode;
|
|
|
|
|
if (GET_MODE_BITSIZE (op_mode) == HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
/* If we were really extending the mode,
|
|
|
|
|
we would have to distinguish between zero-extension
|
|
|
|
|
and sign-extension. */
|
|
|
|
|
if (width != GET_MODE_BITSIZE (op_mode))
|
|
|
|
|
abort ();
|
|
|
|
|
val = arg0;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_MODE_BITSIZE (op_mode) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
val
|
|
|
|
|
= arg0 & ~((HOST_WIDE_INT) (-1) << GET_MODE_BITSIZE (op_mode));
|
|
|
|
|
if (val
|
|
|
|
|
& ((HOST_WIDE_INT) 1 << (GET_MODE_BITSIZE (op_mode) - 1)))
|
|
|
|
|
val -= (HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (op_mode);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SQRT:
|
2000-09-17 16:33:37 +02:00
|
|
|
|
case FLOAT_EXTEND:
|
|
|
|
|
case FLOAT_TRUNCATE:
|
2002-01-12 08:38:50 +01:00
|
|
|
|
case SS_TRUNCATE:
|
|
|
|
|
case US_TRUNCATE:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val = trunc_int_for_mode (val, mode);
|
|
|
|
|
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We can do some operations on integer CONST_DOUBLEs. Also allow
|
|
|
|
|
for a DImode operation on a CONST_INT. */
|
2002-02-21 00:15:00 +01:00
|
|
|
|
else if (GET_MODE (trueop) == VOIDmode
|
|
|
|
|
&& width <= HOST_BITS_PER_WIDE_INT * 2
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& (GET_CODE (trueop) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2000-05-23 20:06:22 +02:00
|
|
|
|
unsigned HOST_WIDE_INT l1, lv;
|
|
|
|
|
HOST_WIDE_INT h1, hv;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop) == CONST_DOUBLE)
|
|
|
|
|
l1 = CONST_DOUBLE_LOW (trueop), h1 = CONST_DOUBLE_HIGH (trueop);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
else
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l1 = INTVAL (trueop), h1 = HWI_SIGN_EXTEND (l1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case NOT:
|
|
|
|
|
lv = ~ l1;
|
|
|
|
|
hv = ~ h1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NEG:
|
|
|
|
|
neg_double (l1, h1, &lv, &hv);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ABS:
|
|
|
|
|
if (h1 < 0)
|
|
|
|
|
neg_double (l1, h1, &lv, &hv);
|
|
|
|
|
else
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case FFS:
|
|
|
|
|
hv = 0;
|
|
|
|
|
if (l1 == 0)
|
|
|
|
|
lv = HOST_BITS_PER_WIDE_INT + exact_log2 (h1 & (-h1)) + 1;
|
|
|
|
|
else
|
|
|
|
|
lv = exact_log2 (l1 & (-l1)) + 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case TRUNCATE:
|
|
|
|
|
/* This is just a change-of-mode, so do nothing. */
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ZERO_EXTEND:
|
2002-02-21 00:15:00 +01:00
|
|
|
|
if (op_mode == VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
hv = 0;
|
|
|
|
|
lv = l1 & GET_MODE_MASK (op_mode);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGN_EXTEND:
|
|
|
|
|
if (op_mode == VOIDmode
|
|
|
|
|
|| GET_MODE_BITSIZE (op_mode) > HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
return 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lv = l1 & GET_MODE_MASK (op_mode);
|
|
|
|
|
if (GET_MODE_BITSIZE (op_mode) < HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& (lv & ((HOST_WIDE_INT) 1
|
|
|
|
|
<< (GET_MODE_BITSIZE (op_mode) - 1))) != 0)
|
|
|
|
|
lv -= (HOST_WIDE_INT) 1 << GET_MODE_BITSIZE (op_mode);
|
|
|
|
|
|
2000-05-24 22:26:54 +02:00
|
|
|
|
hv = HWI_SIGN_EXTEND (lv);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SQRT:
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return immed_double_const (lv, hv, mode);
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (GET_CODE (trueop) == CONST_DOUBLE
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT)
|
|
|
|
|
{
|
2002-03-25 21:52:28 +01:00
|
|
|
|
REAL_VALUE_TYPE d;
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case SQRT:
|
|
|
|
|
/* We don't attempt to optimize this. */
|
|
|
|
|
return 0;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
case ABS: d = REAL_VALUE_ABS (d); break;
|
|
|
|
|
case NEG: d = REAL_VALUE_NEGATE (d); break;
|
|
|
|
|
case FLOAT_TRUNCATE: d = real_value_truncate (mode, d); break;
|
|
|
|
|
case FLOAT_EXTEND: /* All this does is change the mode. */ break;
|
|
|
|
|
case FIX: d = REAL_VALUE_RNDZINT (d); break;
|
|
|
|
|
case UNSIGNED_FIX: d = REAL_VALUE_UNSIGNED_RNDZINT (d); break;
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (d, mode);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (GET_CODE (trueop) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (trueop)) == MODE_FLOAT
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
&& width <= HOST_BITS_PER_WIDE_INT && width > 0)
|
|
|
|
|
{
|
2002-03-25 21:52:28 +01:00
|
|
|
|
HOST_WIDE_INT i;
|
|
|
|
|
REAL_VALUE_TYPE d;
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop);
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case FIX: i = REAL_VALUE_FIX (d); break;
|
|
|
|
|
case UNSIGNED_FIX: i = REAL_VALUE_UNSIGNED_FIX (d); break;
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
return gen_int_mode (i, mode);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
emit-rtl.c, [...]: Remove all #ifndef REAL_ARITHMETIC blocks...
* emit-rtl.c, final.c, fold-const.c, gengenrtl.c, optabs.c,
print-tree.c, real.c, real.h, recog.c, rtl.c, simplify-rtx.c,
tree.c, config/m68k/m68k.c, f/com.c, f/target.h, java/expr.c,
java/jcf-parse.c, java/lex.c:
Remove all #ifndef REAL_ARITHMETIC blocks, make all #ifdef
REAL_ARITHMETIC blocks unconditional. Delete some further
#ifdef blocks predicated on REAL_ARITHMETIC.
* flags.h, toplev.c: Delete remaining references to
flag_pretend_float.
* doc/invoke.texi: Remove documentation of -fpretend-float.
* doc/tm.texi: Describe the various REAL_* macros as provided by
real.h, not by the target configuration files.
* config/alpha/alpha.h, config/alpha/unicosmk.h, config/arm/arm.h,
config/avr/avr.h, config/c4x/c4x.h, config/convex/convex.h,
config/cris/cris.h, config/d30v/d30v.h, config/dsp16xx/dsp16xx.h,
config/h8300/h8300.h, config/i370/i370.h, config/i386/i386.h,
config/i386/osf1elf.h, config/i960/i960.h, config/ia64/ia64.h,
config/m32r/m32r.h, config/m68hc11/m68hc11.h, config/m68k/dpx2.h,
config/m68k/linux-aout.h, config/m68k/linux.h, config/m68k/m68k.h,
config/m68k/sun3.h, config/m68k/vxm68k.h, config/mcore/mcore.h,
config/mips/mips.h, config/mmix/mmix.h, config/mn10200/mn10200.h,
config/mn10300/mn10300.h, config/pa/pa.h, config/pj/pj.h,
config/rs6000/rs6000.h, config/s390/s390.h, config/sh/sh.h,
config/sparc/freebsd.h, config/sparc/linux.h, config/sparc/linux64.h,
config/sparc/sol2.h, config/sparc/sparc.h, config/sparc/vxsim.h,
config/stormy16/stormy16.h, config/v850/v850.h, config/vax/vax.h,
config/xtensa/xtensa.h:
Do not define, undefine, or mention in comments any of
REAL_ARITHMETIC, REAL_VALUE_ATOF, REAL_VALUE_HTOF,
REAL_VALUE_ISNAN, REAL_VALUE_ISINF,
REAL_VALUE_TO_TARGET_SINGLE, REAL_VALUE_TO_TARGET_DOUBLE,
REAL_VALUE_TO_TARGET_LONG_DOUBLE, REAL_VALUE_TO_DECIMAL,
REAL_VALUE_TYPE, REAL_VALUES_EQUAL, REAL_VALUES_LESS,
REAL_VALUE_LDEXP, REAL_VALUE_FIX, REAL_VALUE_UNSIGNED_FIX,
REAL_VALUE_RNDZINT, REAL_VALUE_UNSIGNED_RNDZINT,
REAL_INFINITY, REAL_VALUE_NEGATE, REAL_VALUE_TRUNCATE,
REAL_VALUE_TO_INT, or REAL_VALUE_FROM_INT.
From-SVN: r50263
2002-03-03 22:10:09 +01:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* This was formerly used only for non-IEEE float.
|
|
|
|
|
eggert@twinsun.com says it is safe for IEEE also. */
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-01-08 16:16:40 +01:00
|
|
|
|
enum rtx_code reversed;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* There are some simplifications we can do even if the operands
|
|
|
|
|
aren't constant. */
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case NOT:
|
2000-09-18 20:24:32 +02:00
|
|
|
|
/* (not (not X)) == X. */
|
|
|
|
|
if (GET_CODE (op) == NOT)
|
|
|
|
|
return XEXP (op, 0);
|
|
|
|
|
|
|
|
|
|
/* (not (eq X Y)) == (ne X Y), etc. */
|
|
|
|
|
if (mode == BImode && GET_RTX_CLASS (GET_CODE (op)) == '<'
|
2001-01-08 16:16:40 +01:00
|
|
|
|
&& ((reversed = reversed_comparison_code (op, NULL_RTX))
|
|
|
|
|
!= UNKNOWN))
|
|
|
|
|
return gen_rtx_fmt_ee (reversed,
|
2000-09-18 20:24:32 +02:00
|
|
|
|
op_mode, XEXP (op, 0), XEXP (op, 1));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NEG:
|
|
|
|
|
/* (neg (neg X)) == X. */
|
|
|
|
|
if (GET_CODE (op) == NEG)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return XEXP (op, 0);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SIGN_EXTEND:
|
|
|
|
|
/* (sign_extend (truncate (minus (label_ref L1) (label_ref L2))))
|
|
|
|
|
becomes just the MINUS if its mode is MODE. This allows
|
|
|
|
|
folding switch statements on machines using casesi (such as
|
combine.c, [...]: consistently use "VAX", "VAXen", and "MicroVAX" in comments and documentation.
* combine.c, config.gcc, cse.c, defaults.h, real.c, reload.c,
simplify-rtx.c, config/alpha/alpha.h, config/avr/avr.h,
config/convex/convex.h, config/d30v/d30v.c,
config/d30v/d30v.h, config/dsp16xx/dsp16xx.h,
config/elxsi/elxsi.h, config/fr30/fr30.h, config/m88k/m88k.c,
config/mips/mips.h, config/mn10200/mn10200.h,
config/mn10300/mn10300.h, config/pdp11/pdp11.md,
config/v850/v850.h, config/vax/openbsd.h,
config/vax/openbsd1.h, config/vax/ultrix.h,
config/vax/vax-protos.h, config/vax/vax.c, config/vax/vax.h,
config/vax/vax.md, config/vax/vaxv.h, config/vax/xm-vms.h,
cp/decl2.c, doc/contrib.texi, doc/cpp.texi, doc/gcc.texi,
doc/install.texi, doc/invoke.texi, doc/md.texi, doc/rtl.texi,
doc/tm.texi: consistently use "VAX", "VAXen", and "MicroVAX"
in comments and documentation.
From-SVN: r44589
2001-08-03 03:19:20 +02:00
|
|
|
|
the VAX). */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (GET_CODE (op) == TRUNCATE
|
|
|
|
|
&& GET_MODE (XEXP (op, 0)) == mode
|
|
|
|
|
&& GET_CODE (XEXP (op, 0)) == MINUS
|
|
|
|
|
&& GET_CODE (XEXP (XEXP (op, 0), 0)) == LABEL_REF
|
|
|
|
|
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == LABEL_REF)
|
|
|
|
|
return XEXP (op, 0);
|
|
|
|
|
|
* tm.texi (POINTERS_EXTEND_UNSIGNED) Modify definition.
* optabs.c (can_extend_p) Check HAVE_ptr_extend for a specialized
pointer extension instruction.
* combine.c (nonzero_bits,num_sign_bit_copies) Likewise.
* simplify-rtx.c (simplify_unary_operation) Likewise.
* explow.c (convert_memory_address) Check value of
POINTERS_EXTEND_UNSIGNED to avoid some conversions when
less than zero.
* config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, MULTILIB_OPTIONS,
MULTILIB_DIRNAMES, MULTILIB_MATCHES) Add multilib support.
* config/ia64/hpux.h (CPP_SPEC, ASM_SPEC, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTERS_EXTEND_UNSIGNED) Define for ILP32 support.
* config/ia64/ia64.h (MASK_ILP32, TARGET_ILP32, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTER_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE) Modify for ILP32
support.
* config/ia64/ia64.c (rtx_needs_barrier) Add support for addp4.
* config/ia64/ia64.md (ptr_extend) New instruction to "swizzle"
a 32 bit HP-UX pointer into a 64 bit HP-UX pointer.
From-SVN: r44166
2001-07-20 01:26:51 +02:00
|
|
|
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (! POINTERS_EXTEND_UNSIGNED
|
|
|
|
|
&& mode == Pmode && GET_MODE (op) == ptr_mode
|
2001-02-06 13:39:15 +01:00
|
|
|
|
&& (CONSTANT_P (op)
|
|
|
|
|
|| (GET_CODE (op) == SUBREG
|
|
|
|
|
&& GET_CODE (SUBREG_REG (op)) == REG
|
|
|
|
|
&& REG_POINTER (SUBREG_REG (op))
|
|
|
|
|
&& GET_MODE (SUBREG_REG (op)) == Pmode)))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return convert_memory_address (Pmode, op);
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
|
* tm.texi (POINTERS_EXTEND_UNSIGNED) Modify definition.
* optabs.c (can_extend_p) Check HAVE_ptr_extend for a specialized
pointer extension instruction.
* combine.c (nonzero_bits,num_sign_bit_copies) Likewise.
* simplify-rtx.c (simplify_unary_operation) Likewise.
* explow.c (convert_memory_address) Check value of
POINTERS_EXTEND_UNSIGNED to avoid some conversions when
less than zero.
* config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, MULTILIB_OPTIONS,
MULTILIB_DIRNAMES, MULTILIB_MATCHES) Add multilib support.
* config/ia64/hpux.h (CPP_SPEC, ASM_SPEC, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTERS_EXTEND_UNSIGNED) Define for ILP32 support.
* config/ia64/ia64.h (MASK_ILP32, TARGET_ILP32, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTER_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE) Modify for ILP32
support.
* config/ia64/ia64.c (rtx_needs_barrier) Add support for addp4.
* config/ia64/ia64.md (ptr_extend) New instruction to "swizzle"
a 32 bit HP-UX pointer into a 64 bit HP-UX pointer.
From-SVN: r44166
2001-07-20 01:26:51 +02:00
|
|
|
|
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
case ZERO_EXTEND:
|
* tm.texi (POINTERS_EXTEND_UNSIGNED) Modify definition.
* optabs.c (can_extend_p) Check HAVE_ptr_extend for a specialized
pointer extension instruction.
* combine.c (nonzero_bits,num_sign_bit_copies) Likewise.
* simplify-rtx.c (simplify_unary_operation) Likewise.
* explow.c (convert_memory_address) Check value of
POINTERS_EXTEND_UNSIGNED to avoid some conversions when
less than zero.
* config/ia64/t-hpux (LIBGCC, INSTALL_LIBGCC, MULTILIB_OPTIONS,
MULTILIB_DIRNAMES, MULTILIB_MATCHES) Add multilib support.
* config/ia64/hpux.h (CPP_SPEC, ASM_SPEC, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTERS_EXTEND_UNSIGNED) Define for ILP32 support.
* config/ia64/ia64.h (MASK_ILP32, TARGET_ILP32, SUBTARGET_SWITCHES)
Add Multilib Support.
(POINTER_SIZE, LONG_TYPE_SIZE, MAX_LONG_TYPE_SIZE) Modify for ILP32
support.
* config/ia64/ia64.c (rtx_needs_barrier) Add support for addp4.
* config/ia64/ia64.md (ptr_extend) New instruction to "swizzle"
a 32 bit HP-UX pointer into a 64 bit HP-UX pointer.
From-SVN: r44166
2001-07-20 01:26:51 +02:00
|
|
|
|
if (POINTERS_EXTEND_UNSIGNED > 0
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& mode == Pmode && GET_MODE (op) == ptr_mode
|
2001-02-06 13:39:15 +01:00
|
|
|
|
&& (CONSTANT_P (op)
|
|
|
|
|
|| (GET_CODE (op) == SUBREG
|
|
|
|
|
&& GET_CODE (SUBREG_REG (op)) == REG
|
|
|
|
|
&& REG_POINTER (SUBREG_REG (op))
|
|
|
|
|
&& GET_MODE (SUBREG_REG (op)) == Pmode)))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return convert_memory_address (Pmode, op);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Simplify a binary operation CODE with result mode MODE, operating on OP0
|
|
|
|
|
and OP1. Return 0 if no simplification is possible.
|
|
|
|
|
|
|
|
|
|
Don't use this for relational operations such as EQ or LT.
|
|
|
|
|
Use simplify_relational_operation instead. */
|
|
|
|
|
rtx
|
|
|
|
|
simplify_binary_operation (code, mode, op0, op1)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op0, op1;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
HOST_WIDE_INT arg0, arg1, arg0s, arg1s;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
HOST_WIDE_INT val;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int width = GET_MODE_BITSIZE (mode);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
rtx tem;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
rtx trueop0 = avoid_constant_pool_reference (op0);
|
|
|
|
|
rtx trueop1 = avoid_constant_pool_reference (op1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* Relational operations don't work here. We must know the mode
|
|
|
|
|
of the operands in order to do the comparison correctly.
|
|
|
|
|
Assuming a full word can give incorrect results.
|
|
|
|
|
Consider comparing 128 with -128 in QImode. */
|
|
|
|
|
|
|
|
|
|
if (GET_RTX_CLASS (code) == '<')
|
|
|
|
|
abort ();
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
/* Make sure the constant is second. */
|
|
|
|
|
if (GET_RTX_CLASS (code) == 'c'
|
|
|
|
|
&& swap_commutative_operands_p (trueop0, trueop1))
|
|
|
|
|
{
|
|
|
|
|
tem = op0, op0 = op1, op1 = tem;
|
|
|
|
|
tem = trueop0, trueop0 = trueop1, trueop1 = tem;
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_FLOAT
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& GET_CODE (trueop0) == CONST_DOUBLE
|
|
|
|
|
&& GET_CODE (trueop1) == CONST_DOUBLE
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& mode == GET_MODE (op0) && mode == GET_MODE (op1))
|
|
|
|
|
{
|
2002-03-25 21:52:28 +01:00
|
|
|
|
REAL_VALUE_TYPE f0, f1, value;
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (f0, trueop0);
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (f1, trueop1);
|
|
|
|
|
f0 = real_value_truncate (mode, f0);
|
|
|
|
|
f1 = real_value_truncate (mode, f1);
|
|
|
|
|
|
|
|
|
|
if (code == DIV
|
|
|
|
|
&& !MODE_HAS_INFINITIES (mode)
|
|
|
|
|
&& REAL_VALUES_EQUAL (f1, dconst0))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
REAL_ARITHMETIC (value, rtx_to_tree_code (code), f0, f1);
|
|
|
|
|
|
|
|
|
|
value = real_value_truncate (mode, value);
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (value, mode);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We can fold some multi-word operations. */
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
&& width == HOST_BITS_PER_WIDE_INT * 2
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& (GET_CODE (trueop0) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop0) == CONST_INT)
|
|
|
|
|
&& (GET_CODE (trueop1) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop1) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2000-05-23 20:06:22 +02:00
|
|
|
|
unsigned HOST_WIDE_INT l1, l2, lv;
|
|
|
|
|
HOST_WIDE_INT h1, h2, hv;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop0) == CONST_DOUBLE)
|
|
|
|
|
l1 = CONST_DOUBLE_LOW (trueop0), h1 = CONST_DOUBLE_HIGH (trueop0);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
else
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l1 = INTVAL (trueop0), h1 = HWI_SIGN_EXTEND (l1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_DOUBLE)
|
|
|
|
|
l2 = CONST_DOUBLE_LOW (trueop1), h2 = CONST_DOUBLE_HIGH (trueop1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
else
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l2 = INTVAL (trueop1), h2 = HWI_SIGN_EXTEND (l2);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case MINUS:
|
|
|
|
|
/* A - B == A + (-B). */
|
|
|
|
|
neg_double (l2, h2, &lv, &hv);
|
|
|
|
|
l2 = lv, h2 = hv;
|
|
|
|
|
|
|
|
|
|
/* .. fall through ... */
|
|
|
|
|
|
|
|
|
|
case PLUS:
|
|
|
|
|
add_double (l1, h1, l2, h2, &lv, &hv);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MULT:
|
|
|
|
|
mul_double (l1, h1, l2, h2, &lv, &hv);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DIV: case MOD: case UDIV: case UMOD:
|
|
|
|
|
/* We'd need to include tree.h to do this and it doesn't seem worth
|
|
|
|
|
it. */
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case AND:
|
|
|
|
|
lv = l1 & l2, hv = h1 & h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IOR:
|
|
|
|
|
lv = l1 | l2, hv = h1 | h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case XOR:
|
|
|
|
|
lv = l1 ^ l2, hv = h1 ^ h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SMIN:
|
|
|
|
|
if (h1 < h2
|
|
|
|
|
|| (h1 == h2
|
|
|
|
|
&& ((unsigned HOST_WIDE_INT) l1
|
|
|
|
|
< (unsigned HOST_WIDE_INT) l2)))
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
else
|
|
|
|
|
lv = l2, hv = h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SMAX:
|
|
|
|
|
if (h1 > h2
|
|
|
|
|
|| (h1 == h2
|
|
|
|
|
&& ((unsigned HOST_WIDE_INT) l1
|
|
|
|
|
> (unsigned HOST_WIDE_INT) l2)))
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
else
|
|
|
|
|
lv = l2, hv = h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMIN:
|
|
|
|
|
if ((unsigned HOST_WIDE_INT) h1 < (unsigned HOST_WIDE_INT) h2
|
|
|
|
|
|| (h1 == h2
|
|
|
|
|
&& ((unsigned HOST_WIDE_INT) l1
|
|
|
|
|
< (unsigned HOST_WIDE_INT) l2)))
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
else
|
|
|
|
|
lv = l2, hv = h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMAX:
|
|
|
|
|
if ((unsigned HOST_WIDE_INT) h1 > (unsigned HOST_WIDE_INT) h2
|
|
|
|
|
|| (h1 == h2
|
|
|
|
|
&& ((unsigned HOST_WIDE_INT) l1
|
|
|
|
|
> (unsigned HOST_WIDE_INT) l2)))
|
|
|
|
|
lv = l1, hv = h1;
|
|
|
|
|
else
|
|
|
|
|
lv = l2, hv = h2;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LSHIFTRT: case ASHIFTRT:
|
|
|
|
|
case ASHIFT:
|
|
|
|
|
case ROTATE: case ROTATERT:
|
|
|
|
|
#ifdef SHIFT_COUNT_TRUNCATED
|
|
|
|
|
if (SHIFT_COUNT_TRUNCATED)
|
|
|
|
|
l2 &= (GET_MODE_BITSIZE (mode) - 1), h2 = 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-05-23 20:06:22 +02:00
|
|
|
|
if (h2 != 0 || l2 >= GET_MODE_BITSIZE (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (code == LSHIFTRT || code == ASHIFTRT)
|
|
|
|
|
rshift_double (l1, h1, l2, GET_MODE_BITSIZE (mode), &lv, &hv,
|
|
|
|
|
code == ASHIFTRT);
|
|
|
|
|
else if (code == ASHIFT)
|
|
|
|
|
lshift_double (l1, h1, l2, GET_MODE_BITSIZE (mode), &lv, &hv, 1);
|
|
|
|
|
else if (code == ROTATE)
|
|
|
|
|
lrotate_double (l1, h1, l2, GET_MODE_BITSIZE (mode), &lv, &hv);
|
|
|
|
|
else /* code == ROTATERT */
|
|
|
|
|
rrotate_double (l1, h1, l2, GET_MODE_BITSIZE (mode), &lv, &hv);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return immed_double_const (lv, hv, mode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op0) != CONST_INT || GET_CODE (op1) != CONST_INT
|
|
|
|
|
|| width > HOST_BITS_PER_WIDE_INT || width == 0)
|
|
|
|
|
{
|
|
|
|
|
/* Even if we can't compute a constant result,
|
|
|
|
|
there are some cases worth simplifying. */
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* Maybe simplify x + 0 to x. The two expressions are equivalent
|
|
|
|
|
when x is NaN, infinite, or finite and non-zero. They aren't
|
|
|
|
|
when x is -0 and the rounding mode is not towards -infinity,
|
|
|
|
|
since (-0) + 0 is then 0. */
|
|
|
|
|
if (!HONOR_SIGNED_ZEROS (mode) && trueop1 == CONST0_RTX (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* ((-a) + b) -> (b - a) and similarly for (a + (-b)). These
|
|
|
|
|
transformations are safe even for IEEE. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (GET_CODE (op0) == NEG)
|
|
|
|
|
return simplify_gen_binary (MINUS, mode, op1, XEXP (op0, 0));
|
|
|
|
|
else if (GET_CODE (op1) == NEG)
|
|
|
|
|
return simplify_gen_binary (MINUS, mode, op0, XEXP (op1, 0));
|
|
|
|
|
|
2001-05-05 02:32:19 +02:00
|
|
|
|
/* (~a) + 1 -> -a */
|
|
|
|
|
if (INTEGRAL_MODE_P (mode)
|
|
|
|
|
&& GET_CODE (op0) == NOT
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& trueop1 == const1_rtx)
|
2001-05-05 02:32:19 +02:00
|
|
|
|
return gen_rtx_NEG (mode, XEXP (op0, 0));
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* Handle both-operands-constant cases. We can only add
|
|
|
|
|
CONST_INTs to constants since the sum of relocatable symbols
|
|
|
|
|
can't be handled by most assemblers. Don't add CONST_INT
|
|
|
|
|
to CONST_INT since overflow won't be computed properly if wider
|
|
|
|
|
than HOST_BITS_PER_WIDE_INT. */
|
|
|
|
|
|
|
|
|
|
if (CONSTANT_P (op0) && GET_MODE (op0) != VOIDmode
|
|
|
|
|
&& GET_CODE (op1) == CONST_INT)
|
|
|
|
|
return plus_constant (op0, INTVAL (op1));
|
|
|
|
|
else if (CONSTANT_P (op1) && GET_MODE (op1) != VOIDmode
|
|
|
|
|
&& GET_CODE (op0) == CONST_INT)
|
|
|
|
|
return plus_constant (op1, INTVAL (op0));
|
|
|
|
|
|
|
|
|
|
/* See if this is something like X * C - X or vice versa or
|
|
|
|
|
if the multiplication is written as a shift. If so, we can
|
|
|
|
|
distribute and make a new multiply, shift, or maybe just
|
|
|
|
|
have X (if C is 2 in the example above). But don't make
|
|
|
|
|
real multiply if we didn't have one before. */
|
|
|
|
|
|
|
|
|
|
if (! FLOAT_MODE_P (mode))
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT coeff0 = 1, coeff1 = 1;
|
|
|
|
|
rtx lhs = op0, rhs = op1;
|
|
|
|
|
int had_mult = 0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (lhs) == NEG)
|
|
|
|
|
coeff0 = -1, lhs = XEXP (lhs, 0);
|
|
|
|
|
else if (GET_CODE (lhs) == MULT
|
|
|
|
|
&& GET_CODE (XEXP (lhs, 1)) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff0 = INTVAL (XEXP (lhs, 1)), lhs = XEXP (lhs, 0);
|
|
|
|
|
had_mult = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (lhs) == ASHIFT
|
|
|
|
|
&& GET_CODE (XEXP (lhs, 1)) == CONST_INT
|
|
|
|
|
&& INTVAL (XEXP (lhs, 1)) >= 0
|
|
|
|
|
&& INTVAL (XEXP (lhs, 1)) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff0 = ((HOST_WIDE_INT) 1) << INTVAL (XEXP (lhs, 1));
|
|
|
|
|
lhs = XEXP (lhs, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (rhs) == NEG)
|
|
|
|
|
coeff1 = -1, rhs = XEXP (rhs, 0);
|
|
|
|
|
else if (GET_CODE (rhs) == MULT
|
|
|
|
|
&& GET_CODE (XEXP (rhs, 1)) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff1 = INTVAL (XEXP (rhs, 1)), rhs = XEXP (rhs, 0);
|
|
|
|
|
had_mult = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (rhs) == ASHIFT
|
|
|
|
|
&& GET_CODE (XEXP (rhs, 1)) == CONST_INT
|
|
|
|
|
&& INTVAL (XEXP (rhs, 1)) >= 0
|
|
|
|
|
&& INTVAL (XEXP (rhs, 1)) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff1 = ((HOST_WIDE_INT) 1) << INTVAL (XEXP (rhs, 1));
|
|
|
|
|
rhs = XEXP (rhs, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rtx_equal_p (lhs, rhs))
|
|
|
|
|
{
|
|
|
|
|
tem = simplify_gen_binary (MULT, mode, lhs,
|
|
|
|
|
GEN_INT (coeff0 + coeff1));
|
|
|
|
|
return (GET_CODE (tem) == MULT && ! had_mult) ? 0 : tem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If one of the operands is a PLUS or a MINUS, see if we can
|
2002-05-09 14:02:29 +02:00
|
|
|
|
simplify this by the associative law.
|
1999-11-01 01:18:23 +01:00
|
|
|
|
Don't use the associative law for floating point.
|
|
|
|
|
The inaccuracy makes it nonassociative,
|
|
|
|
|
and subtle programs can break if operations are associated. */
|
|
|
|
|
|
|
|
|
|
if (INTEGRAL_MODE_P (mode)
|
|
|
|
|
&& (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
|
2001-09-07 20:14:32 +02:00
|
|
|
|
|| GET_CODE (op1) == PLUS || GET_CODE (op1) == MINUS
|
|
|
|
|
|| (GET_CODE (op0) == CONST
|
|
|
|
|
&& GET_CODE (XEXP (op0, 0)) == PLUS)
|
|
|
|
|
|| (GET_CODE (op1) == CONST
|
|
|
|
|
&& GET_CODE (XEXP (op1, 0)) == PLUS))
|
2002-02-22 00:06:16 +01:00
|
|
|
|
&& (tem = simplify_plus_minus (code, mode, op0, op1, 0)) != 0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return tem;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case COMPARE:
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
/* Convert (compare FOO (const_int 0)) to FOO unless we aren't
|
|
|
|
|
using cc0, in which case we want to leave it as a COMPARE
|
|
|
|
|
so we can distinguish it from a register-register-copy.
|
|
|
|
|
|
|
|
|
|
In IEEE floating point, x-0 is not the same as x. */
|
|
|
|
|
|
|
|
|
|
if ((TARGET_FLOAT_FORMAT != IEEE_FLOAT_FORMAT
|
2001-03-07 20:29:41 +01:00
|
|
|
|
|| ! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& trueop1 == CONST0_RTX (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
2000-07-17 20:31:50 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Convert (compare (gt (flags) 0) (lt (flags) 0)) to (flags). */
|
|
|
|
|
if (((GET_CODE (op0) == GT && GET_CODE (op1) == LT)
|
|
|
|
|
|| (GET_CODE (op0) == GTU && GET_CODE (op1) == LTU))
|
|
|
|
|
&& XEXP (op0, 1) == const0_rtx && XEXP (op1, 1) == const0_rtx)
|
|
|
|
|
{
|
|
|
|
|
rtx xop00 = XEXP (op0, 0);
|
|
|
|
|
rtx xop10 = XEXP (op1, 0);
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
if (GET_CODE (xop00) == CC0 && GET_CODE (xop10) == CC0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
#else
|
2000-07-17 20:31:50 +02:00
|
|
|
|
if (GET_CODE (xop00) == REG && GET_CODE (xop10) == REG
|
|
|
|
|
&& GET_MODE (xop00) == GET_MODE (xop10)
|
|
|
|
|
&& REGNO (xop00) == REGNO (xop10)
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (xop00)) == MODE_CC
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (xop10)) == MODE_CC)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
#endif
|
2000-07-17 20:31:50 +02:00
|
|
|
|
return xop00;
|
|
|
|
|
}
|
2002-05-09 14:02:29 +02:00
|
|
|
|
break;
|
2001-09-07 20:14:32 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
case MINUS:
|
|
|
|
|
/* We can't assume x-x is 0 even with non-IEEE floating point,
|
|
|
|
|
but since it is zero except in very strange circumstances, we
|
2001-03-07 20:29:41 +01:00
|
|
|
|
will treat it as zero with -funsafe-math-optimizations. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (rtx_equal_p (trueop0, trueop1)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op0)
|
2001-03-07 20:29:41 +01:00
|
|
|
|
&& (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return CONST0_RTX (mode);
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* Change subtraction from zero into negation. (0 - x) is the
|
|
|
|
|
same as -x when x is NaN, infinite, or finite and non-zero.
|
|
|
|
|
But if the mode has signed zeros, and does not round towards
|
|
|
|
|
-infinity, then 0 - 0 is 0, not -0. */
|
|
|
|
|
if (!HONOR_SIGNED_ZEROS (mode) && trueop0 == CONST0_RTX (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_NEG (mode, op1);
|
|
|
|
|
|
|
|
|
|
/* (-1 - a) is ~a. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop0 == constm1_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_NOT (mode, op1);
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* Subtracting 0 has no effect unless the mode has signed zeros
|
|
|
|
|
and supports rounding towards -infinity. In such a case,
|
|
|
|
|
0 - 0 is -0. */
|
|
|
|
|
if (!(HONOR_SIGNED_ZEROS (mode)
|
|
|
|
|
&& HONOR_SIGN_DEPENDENT_ROUNDING (mode))
|
|
|
|
|
&& trueop1 == CONST0_RTX (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
|
|
|
|
|
/* See if this is something like X * C - X or vice versa or
|
|
|
|
|
if the multiplication is written as a shift. If so, we can
|
|
|
|
|
distribute and make a new multiply, shift, or maybe just
|
|
|
|
|
have X (if C is 2 in the example above). But don't make
|
|
|
|
|
real multiply if we didn't have one before. */
|
|
|
|
|
|
|
|
|
|
if (! FLOAT_MODE_P (mode))
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT coeff0 = 1, coeff1 = 1;
|
|
|
|
|
rtx lhs = op0, rhs = op1;
|
|
|
|
|
int had_mult = 0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (lhs) == NEG)
|
|
|
|
|
coeff0 = -1, lhs = XEXP (lhs, 0);
|
|
|
|
|
else if (GET_CODE (lhs) == MULT
|
|
|
|
|
&& GET_CODE (XEXP (lhs, 1)) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff0 = INTVAL (XEXP (lhs, 1)), lhs = XEXP (lhs, 0);
|
|
|
|
|
had_mult = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (lhs) == ASHIFT
|
|
|
|
|
&& GET_CODE (XEXP (lhs, 1)) == CONST_INT
|
|
|
|
|
&& INTVAL (XEXP (lhs, 1)) >= 0
|
|
|
|
|
&& INTVAL (XEXP (lhs, 1)) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff0 = ((HOST_WIDE_INT) 1) << INTVAL (XEXP (lhs, 1));
|
|
|
|
|
lhs = XEXP (lhs, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (rhs) == NEG)
|
|
|
|
|
coeff1 = - 1, rhs = XEXP (rhs, 0);
|
|
|
|
|
else if (GET_CODE (rhs) == MULT
|
|
|
|
|
&& GET_CODE (XEXP (rhs, 1)) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff1 = INTVAL (XEXP (rhs, 1)), rhs = XEXP (rhs, 0);
|
|
|
|
|
had_mult = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (rhs) == ASHIFT
|
|
|
|
|
&& GET_CODE (XEXP (rhs, 1)) == CONST_INT
|
|
|
|
|
&& INTVAL (XEXP (rhs, 1)) >= 0
|
|
|
|
|
&& INTVAL (XEXP (rhs, 1)) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
coeff1 = ((HOST_WIDE_INT) 1) << INTVAL (XEXP (rhs, 1));
|
|
|
|
|
rhs = XEXP (rhs, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (rtx_equal_p (lhs, rhs))
|
|
|
|
|
{
|
|
|
|
|
tem = simplify_gen_binary (MULT, mode, lhs,
|
|
|
|
|
GEN_INT (coeff0 - coeff1));
|
|
|
|
|
return (GET_CODE (tem) == MULT && ! had_mult) ? 0 : tem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* (a - (-b)) -> (a + b). True even for IEEE. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (GET_CODE (op1) == NEG)
|
|
|
|
|
return simplify_gen_binary (PLUS, mode, op0, XEXP (op1, 0));
|
|
|
|
|
|
|
|
|
|
/* If one of the operands is a PLUS or a MINUS, see if we can
|
2002-05-09 14:02:29 +02:00
|
|
|
|
simplify this by the associative law.
|
1999-11-01 01:18:23 +01:00
|
|
|
|
Don't use the associative law for floating point.
|
|
|
|
|
The inaccuracy makes it nonassociative,
|
|
|
|
|
and subtle programs can break if operations are associated. */
|
|
|
|
|
|
|
|
|
|
if (INTEGRAL_MODE_P (mode)
|
|
|
|
|
&& (GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
|
2001-09-07 20:14:32 +02:00
|
|
|
|
|| GET_CODE (op1) == PLUS || GET_CODE (op1) == MINUS
|
|
|
|
|
|| (GET_CODE (op0) == CONST
|
|
|
|
|
&& GET_CODE (XEXP (op0, 0)) == PLUS)
|
|
|
|
|
|| (GET_CODE (op1) == CONST
|
|
|
|
|
&& GET_CODE (XEXP (op1, 0)) == PLUS))
|
2002-02-22 00:06:16 +01:00
|
|
|
|
&& (tem = simplify_plus_minus (code, mode, op0, op1, 0)) != 0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return tem;
|
|
|
|
|
|
|
|
|
|
/* Don't let a relocatable value get a negative coeff. */
|
|
|
|
|
if (GET_CODE (op1) == CONST_INT && GET_MODE (op0) != VOIDmode)
|
2001-12-13 02:21:52 +01:00
|
|
|
|
return simplify_gen_binary (PLUS, mode,
|
|
|
|
|
op0,
|
|
|
|
|
neg_const_int (mode, op1));
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* (x - (x & y)) -> (x & ~y) */
|
|
|
|
|
if (GET_CODE (op1) == AND)
|
|
|
|
|
{
|
|
|
|
|
if (rtx_equal_p (op0, XEXP (op1, 0)))
|
|
|
|
|
return simplify_gen_binary (AND, mode, op0,
|
|
|
|
|
gen_rtx_NOT (mode, XEXP (op1, 1)));
|
|
|
|
|
if (rtx_equal_p (op0, XEXP (op1, 1)))
|
|
|
|
|
return simplify_gen_binary (AND, mode, op0,
|
|
|
|
|
gen_rtx_NOT (mode, XEXP (op1, 0)));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MULT:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == constm1_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
tem = simplify_unary_operation (NEG, mode, op0, mode);
|
|
|
|
|
|
|
|
|
|
return tem ? tem : gen_rtx_NEG (mode, op0);
|
|
|
|
|
}
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* Maybe simplify x * 0 to 0. The reduction is not valid if
|
|
|
|
|
x is NaN, since x * 0 is then also NaN. Nor is it valid
|
|
|
|
|
when the mode has signed zeros, since multiplying a negative
|
|
|
|
|
number by 0 will give -0, not 0. */
|
|
|
|
|
if (!HONOR_NANS (mode)
|
|
|
|
|
&& !HONOR_SIGNED_ZEROS (mode)
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& trueop1 == CONST0_RTX (mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op0))
|
|
|
|
|
return op1;
|
|
|
|
|
|
|
|
|
|
/* In IEEE floating point, x*1 is not equivalent to x for nans.
|
|
|
|
|
However, ANSI says we can drop signals,
|
|
|
|
|
so we can do this anyway. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == CONST1_RTX (mode))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
|
|
|
|
|
/* Convert multiply by constant power of two into shift unless
|
|
|
|
|
we are still generating RTL. This test is a kludge. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& (val = exact_log2 (INTVAL (trueop1))) >= 0
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* If the mode is larger than the host word size, and the
|
|
|
|
|
uppermost bit is set, then this isn't a power of two due
|
|
|
|
|
to implicit sign extension. */
|
|
|
|
|
&& (width <= HOST_BITS_PER_WIDE_INT
|
|
|
|
|
|| val != HOST_BITS_PER_WIDE_INT - 1)
|
|
|
|
|
&& ! rtx_equal_function_value_matters)
|
|
|
|
|
return gen_rtx_ASHIFT (mode, op0, GEN_INT (val));
|
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
/* x*2 is x+x and x*(-1) is -x */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_DOUBLE
|
2002-03-25 21:52:28 +01:00
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (trueop1)) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE (op0) == mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2002-03-25 21:52:28 +01:00
|
|
|
|
REAL_VALUE_TYPE d;
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
if (REAL_VALUES_EQUAL (d, dconst2))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_PLUS (mode, op0, copy_rtx (op0));
|
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
if (REAL_VALUES_EQUAL (d, dconstm1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_NEG (mode, op0);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IOR:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& ((INTVAL (trueop1) & GET_MODE_MASK (mode))
|
|
|
|
|
== GET_MODE_MASK (mode)))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op1;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
/* A | (~A) -> -1 */
|
|
|
|
|
if (((GET_CODE (op0) == NOT && rtx_equal_p (XEXP (op0, 0), op1))
|
|
|
|
|
|| (GET_CODE (op1) == NOT && rtx_equal_p (XEXP (op1, 0), op0)))
|
|
|
|
|
&& ! side_effects_p (op0)
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_CC)
|
|
|
|
|
return constm1_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case XOR:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& ((INTVAL (trueop1) & GET_MODE_MASK (mode))
|
|
|
|
|
== GET_MODE_MASK (mode)))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_NOT (mode, op0);
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop0 == trueop1 && ! side_effects_p (op0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_CC)
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case AND:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return const0_rtx;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& ((INTVAL (trueop1) & GET_MODE_MASK (mode))
|
|
|
|
|
== GET_MODE_MASK (mode)))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop0 == trueop1 && ! side_effects_p (op0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_CC)
|
|
|
|
|
return op0;
|
|
|
|
|
/* A & (~A) -> 0 */
|
|
|
|
|
if (((GET_CODE (op0) == NOT && rtx_equal_p (XEXP (op0, 0), op1))
|
|
|
|
|
|| (GET_CODE (op1) == NOT && rtx_equal_p (XEXP (op1, 0), op0)))
|
|
|
|
|
&& ! side_effects_p (op0)
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_CC)
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UDIV:
|
|
|
|
|
/* Convert divide by power of two into shift (divide by 1 handled
|
|
|
|
|
below). */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& (arg1 = exact_log2 (INTVAL (trueop1))) > 0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_LSHIFTRT (mode, op0, GEN_INT (arg1));
|
|
|
|
|
|
|
|
|
|
/* ... fall through ... */
|
|
|
|
|
|
|
|
|
|
case DIV:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == CONST1_RTX (mode))
|
2001-12-20 09:26:20 +01:00
|
|
|
|
{
|
2002-01-03 18:24:13 +01:00
|
|
|
|
/* On some platforms DIV uses narrower mode than its
|
|
|
|
|
operands. */
|
2001-12-20 09:26:20 +01:00
|
|
|
|
rtx x = gen_lowpart_common (mode, op0);
|
2002-01-03 18:24:13 +01:00
|
|
|
|
if (x)
|
|
|
|
|
return x;
|
|
|
|
|
else if (mode != GET_MODE (op0) && GET_MODE (op0) != VOIDmode)
|
|
|
|
|
return gen_lowpart_SUBREG (mode, op0);
|
|
|
|
|
else
|
|
|
|
|
return op0;
|
2001-12-20 09:26:20 +01:00
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* Maybe change 0 / x to 0. This transformation isn't safe for
|
|
|
|
|
modes with NaNs, since 0 / 0 will then be NaN rather than 0.
|
|
|
|
|
Nor is it safe for modes with signed zeros, since dividing
|
|
|
|
|
0 by a negative number gives -0, not 0. */
|
|
|
|
|
if (!HONOR_NANS (mode)
|
|
|
|
|
&& !HONOR_SIGNED_ZEROS (mode)
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& trueop0 == CONST0_RTX (mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op1))
|
|
|
|
|
return op0;
|
|
|
|
|
|
|
|
|
|
/* Change division by a constant into multiplication. Only do
|
2001-03-07 20:29:41 +01:00
|
|
|
|
this with -funsafe-math-optimizations. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (GET_CODE (trueop1) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (trueop1)) == MODE_FLOAT
|
|
|
|
|
&& trueop1 != CONST0_RTX (mode)
|
2001-03-07 20:29:41 +01:00
|
|
|
|
&& flag_unsafe_math_optimizations)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
REAL_VALUE_TYPE d;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, trueop1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
if (! REAL_VALUES_EQUAL (d, dconst0))
|
|
|
|
|
{
|
|
|
|
|
REAL_ARITHMETIC (d, rtx_to_tree_code (DIV), dconst1, d);
|
2002-05-09 14:02:29 +02:00
|
|
|
|
return gen_rtx_MULT (mode, op0,
|
1999-11-01 01:18:23 +01:00
|
|
|
|
CONST_DOUBLE_FROM_REAL_VALUE (d, mode));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMOD:
|
|
|
|
|
/* Handle modulus by power of two (mod with 1 handled below). */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& exact_log2 (INTVAL (trueop1)) > 0)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return gen_rtx_AND (mode, op0, GEN_INT (INTVAL (op1) - 1));
|
|
|
|
|
|
|
|
|
|
/* ... fall through ... */
|
|
|
|
|
|
|
|
|
|
case MOD:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if ((trueop0 == const0_rtx || trueop1 == const1_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op0) && ! side_effects_p (op1))
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ROTATERT:
|
|
|
|
|
case ROTATE:
|
|
|
|
|
/* Rotating ~0 always results in ~0. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop0) == CONST_INT && width <= HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& (unsigned HOST_WIDE_INT) INTVAL (trueop0) == GET_MODE_MASK (mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op1))
|
|
|
|
|
return op0;
|
|
|
|
|
|
|
|
|
|
/* ... fall through ... */
|
|
|
|
|
|
|
|
|
|
case ASHIFT:
|
|
|
|
|
case ASHIFTRT:
|
|
|
|
|
case LSHIFTRT:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop0 == const0_rtx && ! side_effects_p (op1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SMIN:
|
2002-05-09 14:02:29 +02:00
|
|
|
|
if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (trueop1) == CONST_INT
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& INTVAL (trueop1) == (HOST_WIDE_INT) 1 << (width -1)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& ! side_effects_p (op0))
|
|
|
|
|
return op1;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
break;
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
case SMAX:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (width <= HOST_BITS_PER_WIDE_INT && GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& ((unsigned HOST_WIDE_INT) INTVAL (trueop1)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
== (unsigned HOST_WIDE_INT) GET_MODE_MASK (mode) >> 1)
|
|
|
|
|
&& ! side_effects_p (op0))
|
|
|
|
|
return op1;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMIN:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op1;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
break;
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
case UMAX:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == constm1_rtx && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op1;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (rtx_equal_p (trueop0, trueop1) && ! side_effects_p (op0))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0;
|
|
|
|
|
break;
|
|
|
|
|
|
2002-01-12 08:38:50 +01:00
|
|
|
|
case SS_PLUS:
|
|
|
|
|
case US_PLUS:
|
|
|
|
|
case SS_MINUS:
|
|
|
|
|
case US_MINUS:
|
|
|
|
|
/* ??? There are simplifications that can be done. */
|
|
|
|
|
return 0;
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Get the integer argument values in two forms:
|
|
|
|
|
zero-extended in ARG0, ARG1 and sign-extended in ARG0S, ARG1S. */
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
arg0 = INTVAL (trueop0);
|
|
|
|
|
arg1 = INTVAL (trueop1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
if (width < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
arg0 &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
arg1 &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
|
|
|
|
|
arg0s = arg0;
|
|
|
|
|
if (arg0s & ((HOST_WIDE_INT) 1 << (width - 1)))
|
|
|
|
|
arg0s |= ((HOST_WIDE_INT) (-1) << width);
|
|
|
|
|
|
|
|
|
|
arg1s = arg1;
|
|
|
|
|
if (arg1s & ((HOST_WIDE_INT) 1 << (width - 1)))
|
|
|
|
|
arg1s |= ((HOST_WIDE_INT) (-1) << width);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
arg0s = arg0;
|
|
|
|
|
arg1s = arg1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Compute the value of the arithmetic. */
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
|
|
|
|
val = arg0s + arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MINUS:
|
|
|
|
|
val = arg0s - arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MULT:
|
|
|
|
|
val = arg0s * arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case DIV:
|
2001-04-05 04:27:47 +02:00
|
|
|
|
if (arg1s == 0
|
|
|
|
|
|| (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
|
|
|
|
|
&& arg1s == -1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
val = arg0s / arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MOD:
|
2001-04-05 04:27:47 +02:00
|
|
|
|
if (arg1s == 0
|
|
|
|
|
|| (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
|
|
|
|
|
&& arg1s == -1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
val = arg0s % arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UDIV:
|
2001-04-05 04:27:47 +02:00
|
|
|
|
if (arg1 == 0
|
|
|
|
|
|| (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
|
|
|
|
|
&& arg1s == -1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
val = (unsigned HOST_WIDE_INT) arg0 / arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMOD:
|
2001-04-05 04:27:47 +02:00
|
|
|
|
if (arg1 == 0
|
|
|
|
|
|| (arg0s == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1)
|
|
|
|
|
&& arg1s == -1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return 0;
|
|
|
|
|
val = (unsigned HOST_WIDE_INT) arg0 % arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case AND:
|
|
|
|
|
val = arg0 & arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IOR:
|
|
|
|
|
val = arg0 | arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case XOR:
|
|
|
|
|
val = arg0 ^ arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LSHIFTRT:
|
|
|
|
|
/* If shift count is undefined, don't fold it; let the machine do
|
|
|
|
|
what it wants. But truncate it if the machine will do that. */
|
|
|
|
|
if (arg1 < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
#ifdef SHIFT_COUNT_TRUNCATED
|
|
|
|
|
if (SHIFT_COUNT_TRUNCATED)
|
|
|
|
|
arg1 %= width;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
val = ((unsigned HOST_WIDE_INT) arg0) >> arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ASHIFT:
|
|
|
|
|
if (arg1 < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
#ifdef SHIFT_COUNT_TRUNCATED
|
|
|
|
|
if (SHIFT_COUNT_TRUNCATED)
|
|
|
|
|
arg1 %= width;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
val = ((unsigned HOST_WIDE_INT) arg0) << arg1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ASHIFTRT:
|
|
|
|
|
if (arg1 < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
#ifdef SHIFT_COUNT_TRUNCATED
|
|
|
|
|
if (SHIFT_COUNT_TRUNCATED)
|
|
|
|
|
arg1 %= width;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
val = arg0s >> arg1;
|
|
|
|
|
|
|
|
|
|
/* Bootstrap compiler may not have sign extended the right shift.
|
|
|
|
|
Manually extend the sign to insure bootstrap cc matches gcc. */
|
|
|
|
|
if (arg0s < 0 && arg1 > 0)
|
|
|
|
|
val |= ((HOST_WIDE_INT) -1) << (HOST_BITS_PER_WIDE_INT - arg1);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ROTATERT:
|
|
|
|
|
if (arg1 < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
arg1 %= width;
|
|
|
|
|
val = ((((unsigned HOST_WIDE_INT) arg0) << (width - arg1))
|
|
|
|
|
| (((unsigned HOST_WIDE_INT) arg0) >> arg1));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case ROTATE:
|
|
|
|
|
if (arg1 < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
arg1 %= width;
|
|
|
|
|
val = ((((unsigned HOST_WIDE_INT) arg0) << arg1)
|
|
|
|
|
| (((unsigned HOST_WIDE_INT) arg0) >> (width - arg1)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case COMPARE:
|
|
|
|
|
/* Do nothing here. */
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case SMIN:
|
|
|
|
|
val = arg0s <= arg1s ? arg0s : arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMIN:
|
|
|
|
|
val = ((unsigned HOST_WIDE_INT) arg0
|
|
|
|
|
<= (unsigned HOST_WIDE_INT) arg1 ? arg0 : arg1);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case SMAX:
|
|
|
|
|
val = arg0s > arg1s ? arg0s : arg1s;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case UMAX:
|
|
|
|
|
val = ((unsigned HOST_WIDE_INT) arg0
|
|
|
|
|
> (unsigned HOST_WIDE_INT) arg1 ? arg0 : arg1);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val = trunc_int_for_mode (val, mode);
|
|
|
|
|
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Simplify a PLUS or MINUS, at least one of whose operands may be another
|
|
|
|
|
PLUS or MINUS.
|
|
|
|
|
|
|
|
|
|
Rather than test for specific case, we do this by a brute-force method
|
|
|
|
|
and do all possible simplifications until no more changes occur. Then
|
2002-05-09 14:02:29 +02:00
|
|
|
|
we rebuild the operation.
|
2002-02-22 00:06:16 +01:00
|
|
|
|
|
2002-05-09 14:02:29 +02:00
|
|
|
|
If FORCE is true, then always generate the rtx. This is used to
|
2002-03-07 00:07:08 +01:00
|
|
|
|
canonicalize stuff emitted from simplify_gen_binary. Note that this
|
|
|
|
|
can still fail if the rtx is too complex. It won't fail just because
|
|
|
|
|
the result is not 'simpler' than the input, however. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
struct simplify_plus_minus_op_data
|
|
|
|
|
{
|
|
|
|
|
rtx op;
|
|
|
|
|
int neg;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int
|
|
|
|
|
simplify_plus_minus_op_data_cmp (p1, p2)
|
|
|
|
|
const void *p1;
|
|
|
|
|
const void *p2;
|
|
|
|
|
{
|
|
|
|
|
const struct simplify_plus_minus_op_data *d1 = p1;
|
|
|
|
|
const struct simplify_plus_minus_op_data *d2 = p2;
|
|
|
|
|
|
|
|
|
|
return (commutative_operand_precedence (d2->op)
|
|
|
|
|
- commutative_operand_precedence (d1->op));
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
static rtx
|
2002-02-22 00:06:16 +01:00
|
|
|
|
simplify_plus_minus (code, mode, op0, op1, force)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op0, op1;
|
2002-02-22 00:06:16 +01:00
|
|
|
|
int force;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2001-09-07 20:14:32 +02:00
|
|
|
|
struct simplify_plus_minus_op_data ops[8];
|
1999-11-01 01:18:23 +01:00
|
|
|
|
rtx result, tem;
|
2001-09-07 20:14:32 +02:00
|
|
|
|
int n_ops = 2, input_ops = 2, input_consts = 0, n_consts;
|
|
|
|
|
int first, negate, changed;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
int i, j;
|
|
|
|
|
|
alias.c [...] (init_alias_analysis, [...]): Use memset () instead of bzero ().
* alias.c (init_alias_analysis), calls.c (expand_call,
emit_library_call_value_1), combine.c (init_reg_last_arrays),
cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c
(init_output_buffer, set_diagnostic_context), dwarf2out.c
(equate_decl_number_to_die, build_abbrev_table), emit-rtl.c
(init_emit_once), fold-const.c (mul_double, div_and_round_double),
function.c (assign_parms), gcse.c (compute_can_copy,
alloc_gcse_mem, alloc_reg_set_mem, record_one_set,
compute_hash_table, compute_set_hash_table,
compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c
(global_alloc, global_conflicts), haifa-sched.c (compute_trg_info,
clear_units, schedule_block), integrate.c (initialize_for_inline,
expand_inline_function), jump.c (thread_jumps), local-alloc.c
(local_alloc), loop.c (combine_movables, count_loop_regs_set,
load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree),
regclass.c (init_reg_sets, init_reg_sets_1, regclass,
record_reg_classes, allocate_reg_info), reload.c
(get_secondary_mem, remove_address_replacements, find_reloads),
reload1.c (reload, set_initial_label_offsets, finish_spills,
reload_as_needed, choose_reload_regs_init,
reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c
(sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c
(rename_registers), stmt.c (expand_end_case), unroll.c
(unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset
() instead of bzero ().
ch:
* actions.c (check_missing_cases), typeck.c (build_chill_slice,
build_chill_cast): Use memset () instead of bzero ().
cp:
* class.c (duplicate_tag_error, build_vtbl_initializer), decl.c
(push_binding_level), error.c (cp_tree_printer), pt.c
(process_partial_specialization, tsubst_template_arg_vector),
search.c (lookup_member): Use memset () instead of bzero ().
java:
* expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
(init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
instead of bzero ().
From-SVN: r37303
2000-11-07 23:50:06 +01:00
|
|
|
|
memset ((char *) ops, 0, sizeof ops);
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* Set up the two operands and then expand them until nothing has been
|
|
|
|
|
changed. If we run out of room in our array, give up; this should
|
|
|
|
|
almost never happen. */
|
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
ops[0].op = op0;
|
|
|
|
|
ops[0].neg = 0;
|
|
|
|
|
ops[1].op = op1;
|
|
|
|
|
ops[1].neg = (code == MINUS);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
do
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
changed = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
{
|
|
|
|
|
rtx this_op = ops[i].op;
|
|
|
|
|
int this_neg = ops[i].neg;
|
|
|
|
|
enum rtx_code this_code = GET_CODE (this_op);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
switch (this_code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
|
|
|
|
case MINUS:
|
|
|
|
|
if (n_ops == 7)
|
2002-03-07 00:07:08 +01:00
|
|
|
|
return NULL_RTX;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
ops[n_ops].op = XEXP (this_op, 1);
|
|
|
|
|
ops[n_ops].neg = (this_code == MINUS) ^ this_neg;
|
|
|
|
|
n_ops++;
|
|
|
|
|
|
|
|
|
|
ops[i].op = XEXP (this_op, 0);
|
|
|
|
|
input_ops++;
|
|
|
|
|
changed = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NEG:
|
|
|
|
|
ops[i].op = XEXP (this_op, 0);
|
|
|
|
|
ops[i].neg = ! this_neg;
|
|
|
|
|
changed = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CONST:
|
2002-02-22 00:06:16 +01:00
|
|
|
|
if (n_ops < 7
|
|
|
|
|
&& GET_CODE (XEXP (this_op, 0)) == PLUS
|
|
|
|
|
&& CONSTANT_P (XEXP (XEXP (this_op, 0), 0))
|
|
|
|
|
&& CONSTANT_P (XEXP (XEXP (this_op, 0), 1)))
|
|
|
|
|
{
|
|
|
|
|
ops[i].op = XEXP (XEXP (this_op, 0), 0);
|
|
|
|
|
ops[n_ops].op = XEXP (XEXP (this_op, 0), 1);
|
|
|
|
|
ops[n_ops].neg = this_neg;
|
|
|
|
|
n_ops++;
|
|
|
|
|
input_consts++;
|
|
|
|
|
changed = 1;
|
|
|
|
|
}
|
2001-09-07 20:14:32 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NOT:
|
|
|
|
|
/* ~a -> (-a - 1) */
|
|
|
|
|
if (n_ops != 7)
|
|
|
|
|
{
|
|
|
|
|
ops[n_ops].op = constm1_rtx;
|
2002-01-07 22:13:25 +01:00
|
|
|
|
ops[n_ops++].neg = this_neg;
|
2001-09-07 20:14:32 +02:00
|
|
|
|
ops[i].op = XEXP (this_op, 0);
|
|
|
|
|
ops[i].neg = !this_neg;
|
|
|
|
|
changed = 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
case CONST_INT:
|
|
|
|
|
if (this_neg)
|
|
|
|
|
{
|
2001-12-13 02:21:52 +01:00
|
|
|
|
ops[i].op = neg_const_int (mode, this_op);
|
2001-09-07 20:14:32 +02:00
|
|
|
|
ops[i].neg = 0;
|
|
|
|
|
changed = 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
2001-09-07 20:14:32 +02:00
|
|
|
|
while (changed);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* If we only have two operands, we can't do anything. */
|
2002-02-22 00:06:16 +01:00
|
|
|
|
if (n_ops <= 2 && !force)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
return NULL_RTX;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-02-22 00:06:16 +01:00
|
|
|
|
/* Count the number of CONSTs we didn't split above. */
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (GET_CODE (ops[i].op) == CONST)
|
|
|
|
|
input_consts++;
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* Now simplify each pair of operands until nothing changes. The first
|
|
|
|
|
time through just simplify constants against each other. */
|
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
first = 1;
|
|
|
|
|
do
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
changed = first;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n_ops - 1; i++)
|
|
|
|
|
for (j = i + 1; j < n_ops; j++)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
{
|
|
|
|
|
rtx lhs = ops[i].op, rhs = ops[j].op;
|
|
|
|
|
int lneg = ops[i].neg, rneg = ops[j].neg;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
if (lhs != 0 && rhs != 0
|
|
|
|
|
&& (! first || (CONSTANT_P (lhs) && CONSTANT_P (rhs))))
|
|
|
|
|
{
|
|
|
|
|
enum rtx_code ncode = PLUS;
|
|
|
|
|
|
|
|
|
|
if (lneg != rneg)
|
|
|
|
|
{
|
|
|
|
|
ncode = MINUS;
|
|
|
|
|
if (lneg)
|
|
|
|
|
tem = lhs, lhs = rhs, rhs = tem;
|
|
|
|
|
}
|
|
|
|
|
else if (swap_commutative_operands_p (lhs, rhs))
|
|
|
|
|
tem = lhs, lhs = rhs, rhs = tem;
|
|
|
|
|
|
|
|
|
|
tem = simplify_binary_operation (ncode, mode, lhs, rhs);
|
|
|
|
|
|
2002-05-09 14:02:29 +02:00
|
|
|
|
/* Reject "simplifications" that just wrap the two
|
2001-09-07 20:14:32 +02:00
|
|
|
|
arguments in a CONST. Failure to do so can result
|
|
|
|
|
in infinite recursion with simplify_binary_operation
|
|
|
|
|
when it calls us to simplify CONST operations. */
|
|
|
|
|
if (tem
|
|
|
|
|
&& ! (GET_CODE (tem) == CONST
|
|
|
|
|
&& GET_CODE (XEXP (tem, 0)) == ncode
|
|
|
|
|
&& XEXP (XEXP (tem, 0), 0) == lhs
|
2002-01-07 22:13:25 +01:00
|
|
|
|
&& XEXP (XEXP (tem, 0), 1) == rhs)
|
|
|
|
|
/* Don't allow -x + -1 -> ~x simplifications in the
|
|
|
|
|
first pass. This allows us the chance to combine
|
|
|
|
|
the -1 with other constants. */
|
|
|
|
|
&& ! (first
|
|
|
|
|
&& GET_CODE (tem) == NOT
|
|
|
|
|
&& XEXP (tem, 0) == rhs))
|
2001-09-07 20:14:32 +02:00
|
|
|
|
{
|
|
|
|
|
lneg &= rneg;
|
|
|
|
|
if (GET_CODE (tem) == NEG)
|
|
|
|
|
tem = XEXP (tem, 0), lneg = !lneg;
|
|
|
|
|
if (GET_CODE (tem) == CONST_INT && lneg)
|
2001-12-13 02:21:52 +01:00
|
|
|
|
tem = neg_const_int (mode, tem), lneg = 0;
|
2001-09-07 20:14:32 +02:00
|
|
|
|
|
|
|
|
|
ops[i].op = tem;
|
|
|
|
|
ops[i].neg = lneg;
|
|
|
|
|
ops[j].op = NULL_RTX;
|
|
|
|
|
changed = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
first = 0;
|
|
|
|
|
}
|
2001-09-07 20:14:32 +02:00
|
|
|
|
while (changed);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
/* Pack all the operands to the lower-numbered entries. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
for (i = 0, j = 0; j < n_ops; j++)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
if (ops[j].op)
|
|
|
|
|
ops[i++] = ops[j];
|
|
|
|
|
n_ops = i;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
/* Sort the operations based on swap_commutative_operands_p. */
|
|
|
|
|
qsort (ops, n_ops, sizeof (*ops), simplify_plus_minus_op_data_cmp);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
/* We suppressed creation of trivial CONST expressions in the
|
|
|
|
|
combination loop to avoid recursion. Create one manually now.
|
|
|
|
|
The combination loop should have ensured that there is exactly
|
|
|
|
|
one CONST_INT, and the sort will have ensured that it is last
|
|
|
|
|
in the array and that any other constant will be next-to-last. */
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
if (n_ops > 1
|
|
|
|
|
&& GET_CODE (ops[n_ops - 1].op) == CONST_INT
|
|
|
|
|
&& CONSTANT_P (ops[n_ops - 2].op))
|
|
|
|
|
{
|
2001-12-13 02:21:52 +01:00
|
|
|
|
rtx value = ops[n_ops - 1].op;
|
2001-10-19 21:28:03 +02:00
|
|
|
|
if (ops[n_ops - 1].neg ^ ops[n_ops - 2].neg)
|
2001-12-13 02:21:52 +01:00
|
|
|
|
value = neg_const_int (mode, value);
|
|
|
|
|
ops[n_ops - 2].op = plus_constant (ops[n_ops - 2].op, INTVAL (value));
|
2001-09-07 20:14:32 +02:00
|
|
|
|
n_ops--;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Count the number of CONSTs that we generated. */
|
|
|
|
|
n_consts = 0;
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (GET_CODE (ops[i].op) == CONST)
|
|
|
|
|
n_consts++;
|
|
|
|
|
|
|
|
|
|
/* Give up if we didn't reduce the number of operands we had. Make
|
|
|
|
|
sure we count a CONST as two operands. If we have the same
|
|
|
|
|
number of operands, but have made more CONSTs than before, this
|
|
|
|
|
is also an improvement, so accept it. */
|
2002-02-22 00:06:16 +01:00
|
|
|
|
if (!force
|
|
|
|
|
&& (n_ops + n_consts > input_ops
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|| (n_ops + n_consts == input_ops && n_consts <= input_consts)))
|
2001-09-07 20:14:32 +02:00
|
|
|
|
return NULL_RTX;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* Put a non-negated operand first. If there aren't any, make all
|
|
|
|
|
operands positive and negate the whole thing later. */
|
|
|
|
|
|
2001-09-07 20:14:32 +02:00
|
|
|
|
negate = 0;
|
|
|
|
|
for (i = 0; i < n_ops && ops[i].neg; i++)
|
|
|
|
|
continue;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
if (i == n_ops)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
ops[i].neg = 0;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
negate = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (i != 0)
|
|
|
|
|
{
|
2001-09-07 20:14:32 +02:00
|
|
|
|
tem = ops[0].op;
|
|
|
|
|
ops[0] = ops[i];
|
|
|
|
|
ops[i].op = tem;
|
|
|
|
|
ops[i].neg = 1;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now make the result by performing the requested operations. */
|
2001-09-07 20:14:32 +02:00
|
|
|
|
result = ops[0].op;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
for (i = 1; i < n_ops; i++)
|
2001-09-07 20:14:32 +02:00
|
|
|
|
result = gen_rtx_fmt_ee (ops[i].neg ? MINUS : PLUS,
|
|
|
|
|
mode, result, ops[i].op);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
return negate ? gen_rtx_NEG (mode, result) : result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like simplify_binary_operation except used for relational operators.
|
|
|
|
|
MODE is the mode of the operands, not that of the result. If MODE
|
|
|
|
|
is VOIDmode, both operands must also be VOIDmode and we compare the
|
|
|
|
|
operands in "infinite precision".
|
|
|
|
|
|
|
|
|
|
If no simplification is possible, this function returns zero. Otherwise,
|
|
|
|
|
it returns either const_true_rtx or const0_rtx. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_relational_operation (code, mode, op0, op1)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op0, op1;
|
|
|
|
|
{
|
|
|
|
|
int equal, op0lt, op0ltu, op1lt, op1ltu;
|
|
|
|
|
rtx tem;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
rtx trueop0;
|
|
|
|
|
rtx trueop1;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2000-07-30 20:13:10 +02:00
|
|
|
|
if (mode == VOIDmode
|
|
|
|
|
&& (GET_MODE (op0) != VOIDmode
|
|
|
|
|
|| GET_MODE (op1) != VOIDmode))
|
2000-08-23 09:59:06 +02:00
|
|
|
|
abort ();
|
2000-07-30 20:13:10 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* If op0 is a compare, extract the comparison arguments from it. */
|
|
|
|
|
if (GET_CODE (op0) == COMPARE && op1 == const0_rtx)
|
|
|
|
|
op1 = XEXP (op0, 1), op0 = XEXP (op0, 0);
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
trueop0 = avoid_constant_pool_reference (op0);
|
|
|
|
|
trueop1 = avoid_constant_pool_reference (op1);
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* We can't simplify MODE_CC values since we don't know what the
|
|
|
|
|
actual comparison is. */
|
|
|
|
|
if (GET_MODE_CLASS (GET_MODE (op0)) == MODE_CC
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
|| op0 == cc0_rtx
|
|
|
|
|
#endif
|
|
|
|
|
)
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-02-06 11:56:56 +01:00
|
|
|
|
/* Make sure the constant is second. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (swap_commutative_operands_p (trueop0, trueop1))
|
2000-02-06 11:56:56 +01:00
|
|
|
|
{
|
|
|
|
|
tem = op0, op0 = op1, op1 = tem;
|
2001-07-17 17:11:56 +02:00
|
|
|
|
tem = trueop0, trueop0 = trueop1, trueop1 = tem;
|
2000-02-06 11:56:56 +01:00
|
|
|
|
code = swap_condition (code);
|
|
|
|
|
}
|
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* For integer comparisons of A and B maybe we can simplify A - B and can
|
|
|
|
|
then simplify a comparison of that with zero. If A and B are both either
|
|
|
|
|
a register or a CONST_INT, this can't help; testing for these cases will
|
|
|
|
|
prevent infinite recursion here and speed things up.
|
|
|
|
|
|
|
|
|
|
If CODE is an unsigned comparison, then we can never do this optimization,
|
|
|
|
|
because it gives an incorrect result if the subtraction wraps around zero.
|
|
|
|
|
ANSI C defines unsigned operations such that they never overflow, and
|
|
|
|
|
thus such cases can not be ignored. */
|
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (INTEGRAL_MODE_P (mode) && trueop1 != const0_rtx
|
|
|
|
|
&& ! ((GET_CODE (op0) == REG || GET_CODE (trueop0) == CONST_INT)
|
|
|
|
|
&& (GET_CODE (op1) == REG || GET_CODE (trueop1) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& 0 != (tem = simplify_binary_operation (MINUS, mode, op0, op1))
|
|
|
|
|
&& code != GTU && code != GEU && code != LTU && code != LEU)
|
|
|
|
|
return simplify_relational_operation (signed_condition (code),
|
|
|
|
|
mode, tem, const0_rtx);
|
|
|
|
|
|
2001-03-07 20:29:41 +01:00
|
|
|
|
if (flag_unsafe_math_optimizations && code == ORDERED)
|
2001-01-07 14:40:09 +01:00
|
|
|
|
return const_true_rtx;
|
|
|
|
|
|
2001-03-07 20:29:41 +01:00
|
|
|
|
if (flag_unsafe_math_optimizations && code == UNORDERED)
|
2001-01-07 14:40:09 +01:00
|
|
|
|
return const0_rtx;
|
|
|
|
|
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
/* For modes without NaNs, if the two operands are equal, we know the
|
1999-11-01 01:18:23 +01:00
|
|
|
|
result. */
|
defaults.h (MODE_HAS_NANS, [...]): New.
* defaults.h (MODE_HAS_NANS, MODE_HAS_INFINITIES): New.
(MODE_HAS_SIGNED_ZEROS, MODE_HAS_SIGN_DEPENDENT_ROUNDING): New.
* flags.h (HONOR_NANS, HONOR_INFINITIES, HONOR_SIGNED_ZEROS): New.
(HONOR_SIGN_DEPENDENT_ROUNDING): New.
* builtins.c (expand_builtin_mathfn): Use HONOR_NANS.
* c-common.c (truthvalue_conversion): Reduce x - y != 0 to x != y
unless x and y could be infinite.
(expand_unordered_cmp): New, mostly split from expand_tree_builtin.
Check that the common type of both arguments is a real, even for
targets without unordered comparisons. Allow an integer argument
to be compared against a real.
(expand_tree_builtin): Use expand_unordered_cmp.
* combine.c (combine_simplify_rtx): Use the new HONOR_... macros.
* cse.c (fold_rtx): Likewise. Fix indentation.
* fold-const.c (fold_real_zero_addition_p): New.
(fold): Use it, and the new HONOR_... macros.
* ifcvt.c (noce_try_minmax): Use the new HONOR_... macros.
* jump.c (reversed_comparison_code_parts): After searching for
the true comparison mode, use HONOR_NANS to decide whether it
can be safely reversed.
(reverse_condition_maybe_unordered): Remove IEEE check.
* simplify-rtx.c (simplify_binary_operation): Use the new macros
to decide which simplifications are valid. Allow the following
simplifications for IEEE: (-a + b) to (b - a), (a + -b) to (a - b),
and (a - -b) to (a + b).
(simplify_relational_operation): Use HONOR_NANS.
* doc/tm.texi: Document the MODE_HAS_... macros.
From-SVN: r50401
2002-03-07 12:37:16 +01:00
|
|
|
|
if (!HONOR_NANS (GET_MODE (trueop0)) && rtx_equal_p (trueop0, trueop1))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
equal = 1, op0lt = 0, op0ltu = 0, op1lt = 0, op1ltu = 0;
|
|
|
|
|
|
|
|
|
|
/* If the operands are floating-point constants, see if we can fold
|
|
|
|
|
the result. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
else if (GET_CODE (trueop0) == CONST_DOUBLE
|
|
|
|
|
&& GET_CODE (trueop1) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (trueop0)) == MODE_FLOAT)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2002-03-25 21:52:28 +01:00
|
|
|
|
REAL_VALUE_TYPE d0, d1;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d0, trueop0);
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d1, trueop1);
|
2001-01-05 16:34:39 +01:00
|
|
|
|
|
2002-04-30 22:48:55 +02:00
|
|
|
|
/* Comparisons are unordered iff at least one of the values is NaN. */
|
2002-03-25 21:52:28 +01:00
|
|
|
|
if (REAL_VALUE_ISNAN (d0) || REAL_VALUE_ISNAN (d1))
|
2001-01-05 16:34:39 +01:00
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case UNEQ:
|
|
|
|
|
case UNLT:
|
|
|
|
|
case UNGT:
|
|
|
|
|
case UNLE:
|
|
|
|
|
case UNGE:
|
|
|
|
|
case NE:
|
|
|
|
|
case UNORDERED:
|
|
|
|
|
return const_true_rtx;
|
|
|
|
|
case EQ:
|
|
|
|
|
case LT:
|
|
|
|
|
case GT:
|
|
|
|
|
case LE:
|
|
|
|
|
case GE:
|
|
|
|
|
case LTGT:
|
|
|
|
|
case ORDERED:
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
default:
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
2002-03-25 21:52:28 +01:00
|
|
|
|
equal = REAL_VALUES_EQUAL (d0, d1);
|
|
|
|
|
op0lt = op0ltu = REAL_VALUES_LESS (d0, d1);
|
|
|
|
|
op1lt = op1ltu = REAL_VALUES_LESS (d1, d0);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise, see if the operands are both integers. */
|
|
|
|
|
else if ((GET_MODE_CLASS (mode) == MODE_INT || mode == VOIDmode)
|
2001-07-17 17:11:56 +02:00
|
|
|
|
&& (GET_CODE (trueop0) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop0) == CONST_INT)
|
|
|
|
|
&& (GET_CODE (trueop1) == CONST_DOUBLE
|
|
|
|
|
|| GET_CODE (trueop1) == CONST_INT))
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
int width = GET_MODE_BITSIZE (mode);
|
|
|
|
|
HOST_WIDE_INT l0s, h0s, l1s, h1s;
|
|
|
|
|
unsigned HOST_WIDE_INT l0u, h0u, l1u, h1u;
|
|
|
|
|
|
|
|
|
|
/* Get the two words comprising each integer constant. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop0) == CONST_DOUBLE)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l0u = l0s = CONST_DOUBLE_LOW (trueop0);
|
|
|
|
|
h0u = h0s = CONST_DOUBLE_HIGH (trueop0);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l0u = l0s = INTVAL (trueop0);
|
2000-05-24 22:26:54 +02:00
|
|
|
|
h0u = h0s = HWI_SIGN_EXTEND (l0s);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_DOUBLE)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l1u = l1s = CONST_DOUBLE_LOW (trueop1);
|
|
|
|
|
h1u = h1s = CONST_DOUBLE_HIGH (trueop1);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2001-07-17 17:11:56 +02:00
|
|
|
|
l1u = l1s = INTVAL (trueop1);
|
2000-05-24 22:26:54 +02:00
|
|
|
|
h1u = h1s = HWI_SIGN_EXTEND (l1s);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If WIDTH is nonzero and smaller than HOST_BITS_PER_WIDE_INT,
|
|
|
|
|
we have to sign or zero-extend the values. */
|
|
|
|
|
if (width != 0 && width < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
{
|
|
|
|
|
l0u &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
l1u &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
|
|
|
|
|
if (l0s & ((HOST_WIDE_INT) 1 << (width - 1)))
|
|
|
|
|
l0s |= ((HOST_WIDE_INT) (-1) << width);
|
|
|
|
|
|
|
|
|
|
if (l1s & ((HOST_WIDE_INT) 1 << (width - 1)))
|
|
|
|
|
l1s |= ((HOST_WIDE_INT) (-1) << width);
|
|
|
|
|
}
|
2000-10-26 01:02:14 +02:00
|
|
|
|
if (width != 0 && width <= HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
h0u = h1u = 0, h0s = HWI_SIGN_EXTEND (l0s), h1s = HWI_SIGN_EXTEND (l1s);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
equal = (h0u == h1u && l0u == l1u);
|
2000-07-17 10:41:05 +02:00
|
|
|
|
op0lt = (h0s < h1s || (h0s == h1s && l0u < l1u));
|
|
|
|
|
op1lt = (h1s < h0s || (h1s == h0s && l1u < l0u));
|
1999-11-01 01:18:23 +01:00
|
|
|
|
op0ltu = (h0u < h1u || (h0u == h1u && l0u < l1u));
|
|
|
|
|
op1ltu = (h1u < h0u || (h1u == h0u && l1u < l0u));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise, there are some code-specific tests we can make. */
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case EQ:
|
|
|
|
|
/* References to the frame plus a constant or labels cannot
|
|
|
|
|
be zero, but a SYMBOL_REF can due to #pragma weak. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (((NONZERO_BASE_PLUS_P (op0) && trueop1 == const0_rtx)
|
|
|
|
|
|| GET_CODE (trueop0) == LABEL_REF)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
|
|
|
|
/* On some machines, the ap reg can be 0 sometimes. */
|
|
|
|
|
&& op0 != arg_pointer_rtx
|
|
|
|
|
#endif
|
|
|
|
|
)
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case NE:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (((NONZERO_BASE_PLUS_P (op0) && trueop1 == const0_rtx)
|
|
|
|
|
|| GET_CODE (trueop0) == LABEL_REF)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
|
|
|
|
&& op0 != arg_pointer_rtx
|
|
|
|
|
#endif
|
|
|
|
|
)
|
|
|
|
|
return const_true_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GEU:
|
|
|
|
|
/* Unsigned values are never negative. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return const_true_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LTU:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (trueop1 == const0_rtx)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case LEU:
|
|
|
|
|
/* Unsigned values are never greater than the largest
|
|
|
|
|
unsigned value. */
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& (unsigned HOST_WIDE_INT) INTVAL (trueop1) == GET_MODE_MASK (mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& INTEGRAL_MODE_P (mode))
|
|
|
|
|
return const_true_rtx;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case GTU:
|
2001-07-17 17:11:56 +02:00
|
|
|
|
if (GET_CODE (trueop1) == CONST_INT
|
|
|
|
|
&& (unsigned HOST_WIDE_INT) INTVAL (trueop1) == GET_MODE_MASK (mode)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& INTEGRAL_MODE_P (mode))
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
break;
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we reach here, EQUAL, OP0LT, OP0LTU, OP1LT, and OP1LTU are set
|
|
|
|
|
as appropriate. */
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case EQ:
|
2001-01-05 16:34:39 +01:00
|
|
|
|
case UNEQ:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return equal ? const_true_rtx : const0_rtx;
|
|
|
|
|
case NE:
|
2001-01-05 16:34:39 +01:00
|
|
|
|
case LTGT:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return ! equal ? const_true_rtx : const0_rtx;
|
|
|
|
|
case LT:
|
2001-01-05 16:34:39 +01:00
|
|
|
|
case UNLT:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op0lt ? const_true_rtx : const0_rtx;
|
|
|
|
|
case GT:
|
2001-01-05 16:34:39 +01:00
|
|
|
|
case UNGT:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return op1lt ? const_true_rtx : const0_rtx;
|
|
|
|
|
case LTU:
|
|
|
|
|
return op0ltu ? const_true_rtx : const0_rtx;
|
|
|
|
|
case GTU:
|
|
|
|
|
return op1ltu ? const_true_rtx : const0_rtx;
|
|
|
|
|
case LE:
|
2001-01-07 14:40:09 +01:00
|
|
|
|
case UNLE:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return equal || op0lt ? const_true_rtx : const0_rtx;
|
|
|
|
|
case GE:
|
2001-01-07 14:40:09 +01:00
|
|
|
|
case UNGE:
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return equal || op1lt ? const_true_rtx : const0_rtx;
|
|
|
|
|
case LEU:
|
|
|
|
|
return equal || op0ltu ? const_true_rtx : const0_rtx;
|
|
|
|
|
case GEU:
|
|
|
|
|
return equal || op1ltu ? const_true_rtx : const0_rtx;
|
2001-01-05 16:34:39 +01:00
|
|
|
|
case ORDERED:
|
|
|
|
|
return const_true_rtx;
|
|
|
|
|
case UNORDERED:
|
|
|
|
|
return const0_rtx;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Simplify CODE, an operation with result mode MODE and three operands,
|
|
|
|
|
OP0, OP1, and OP2. OP0_MODE was the mode of OP0 before it became
|
|
|
|
|
a constant. Return 0 if no simplifications is possible. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_ternary_operation (code, mode, op0_mode, op0, op1, op2)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode, op0_mode;
|
|
|
|
|
rtx op0, op1, op2;
|
|
|
|
|
{
|
2000-04-18 20:14:10 +02:00
|
|
|
|
unsigned int width = GET_MODE_BITSIZE (mode);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
/* VOIDmode means "infinite" precision. */
|
|
|
|
|
if (width == 0)
|
|
|
|
|
width = HOST_BITS_PER_WIDE_INT;
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case SIGN_EXTRACT:
|
|
|
|
|
case ZERO_EXTRACT:
|
|
|
|
|
if (GET_CODE (op0) == CONST_INT
|
|
|
|
|
&& GET_CODE (op1) == CONST_INT
|
|
|
|
|
&& GET_CODE (op2) == CONST_INT
|
2000-07-17 20:31:50 +02:00
|
|
|
|
&& ((unsigned) INTVAL (op1) + (unsigned) INTVAL (op2) <= width)
|
2000-05-04 23:15:05 +02:00
|
|
|
|
&& width <= (unsigned) HOST_BITS_PER_WIDE_INT)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
{
|
|
|
|
|
/* Extracting a bit-field from a constant */
|
|
|
|
|
HOST_WIDE_INT val = INTVAL (op0);
|
|
|
|
|
|
|
|
|
|
if (BITS_BIG_ENDIAN)
|
|
|
|
|
val >>= (GET_MODE_BITSIZE (op0_mode)
|
|
|
|
|
- INTVAL (op2) - INTVAL (op1));
|
|
|
|
|
else
|
|
|
|
|
val >>= INTVAL (op2);
|
|
|
|
|
|
|
|
|
|
if (HOST_BITS_PER_WIDE_INT != INTVAL (op1))
|
|
|
|
|
{
|
|
|
|
|
/* First zero-extend. */
|
|
|
|
|
val &= ((HOST_WIDE_INT) 1 << INTVAL (op1)) - 1;
|
|
|
|
|
/* If desired, propagate sign bit. */
|
|
|
|
|
if (code == SIGN_EXTRACT
|
|
|
|
|
&& (val & ((HOST_WIDE_INT) 1 << (INTVAL (op1) - 1))))
|
|
|
|
|
val |= ~ (((HOST_WIDE_INT) 1 << INTVAL (op1)) - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Clear the bits that don't belong in our mode,
|
|
|
|
|
unless they and our sign bit are all one.
|
|
|
|
|
So we get either a reasonable negative value or a reasonable
|
|
|
|
|
unsigned value for this mode. */
|
|
|
|
|
if (width < HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& ((val & ((HOST_WIDE_INT) (-1) << (width - 1)))
|
|
|
|
|
!= ((HOST_WIDE_INT) (-1) << (width - 1))))
|
|
|
|
|
val &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case IF_THEN_ELSE:
|
|
|
|
|
if (GET_CODE (op0) == CONST_INT)
|
|
|
|
|
return op0 != const0_rtx ? op1 : op2;
|
|
|
|
|
|
|
|
|
|
/* Convert a == b ? b : a to "a". */
|
|
|
|
|
if (GET_CODE (op0) == NE && ! side_effects_p (op0)
|
2001-03-07 20:29:41 +01:00
|
|
|
|
&& (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& rtx_equal_p (XEXP (op0, 0), op1)
|
|
|
|
|
&& rtx_equal_p (XEXP (op0, 1), op2))
|
|
|
|
|
return op1;
|
|
|
|
|
else if (GET_CODE (op0) == EQ && ! side_effects_p (op0)
|
2001-03-07 20:29:41 +01:00
|
|
|
|
&& (! FLOAT_MODE_P (mode) || flag_unsafe_math_optimizations)
|
1999-11-01 01:18:23 +01:00
|
|
|
|
&& rtx_equal_p (XEXP (op0, 1), op1)
|
|
|
|
|
&& rtx_equal_p (XEXP (op0, 0), op2))
|
|
|
|
|
return op2;
|
|
|
|
|
else if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0))
|
|
|
|
|
{
|
2000-07-30 20:13:10 +02:00
|
|
|
|
enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode
|
|
|
|
|
? GET_MODE (XEXP (op0, 1))
|
|
|
|
|
: GET_MODE (XEXP (op0, 0)));
|
2001-01-24 22:43:11 +01:00
|
|
|
|
rtx temp;
|
2001-01-24 22:10:06 +01:00
|
|
|
|
if (cmp_mode == VOIDmode)
|
|
|
|
|
cmp_mode = op0_mode;
|
2001-01-24 22:43:11 +01:00
|
|
|
|
temp = simplify_relational_operation (GET_CODE (op0), cmp_mode,
|
|
|
|
|
XEXP (op0, 0), XEXP (op0, 1));
|
2000-04-18 20:14:10 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* See if any simplifications were possible. */
|
|
|
|
|
if (temp == const0_rtx)
|
|
|
|
|
return op2;
|
|
|
|
|
else if (temp == const1_rtx)
|
|
|
|
|
return op1;
|
2000-05-22 10:20:47 +02:00
|
|
|
|
else if (temp)
|
|
|
|
|
op0 = temp;
|
|
|
|
|
|
|
|
|
|
/* Look for happy constants in op1 and op2. */
|
|
|
|
|
if (GET_CODE (op1) == CONST_INT && GET_CODE (op2) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT t = INTVAL (op1);
|
|
|
|
|
HOST_WIDE_INT f = INTVAL (op2);
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
2000-05-22 10:20:47 +02:00
|
|
|
|
if (t == STORE_FLAG_VALUE && f == 0)
|
|
|
|
|
code = GET_CODE (op0);
|
2001-01-08 16:16:40 +01:00
|
|
|
|
else if (t == 0 && f == STORE_FLAG_VALUE)
|
|
|
|
|
{
|
|
|
|
|
enum rtx_code tmp;
|
|
|
|
|
tmp = reversed_comparison_code (op0, NULL_RTX);
|
|
|
|
|
if (tmp == UNKNOWN)
|
|
|
|
|
break;
|
|
|
|
|
code = tmp;
|
|
|
|
|
}
|
2000-05-22 10:20:47 +02:00
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
return gen_rtx_fmt_ee (code, mode, XEXP (op0, 0), XEXP (op0, 1));
|
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2001-05-17 17:00:35 +02:00
|
|
|
|
/* Simplify SUBREG:OUTERMODE(OP:INNERMODE, BYTE)
|
|
|
|
|
Return 0 if no simplifications is possible. */
|
|
|
|
|
rtx
|
|
|
|
|
simplify_subreg (outermode, op, innermode, byte)
|
|
|
|
|
rtx op;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
enum machine_mode outermode, innermode;
|
|
|
|
|
{
|
|
|
|
|
/* Little bit of sanity checking. */
|
|
|
|
|
if (innermode == VOIDmode || outermode == VOIDmode
|
|
|
|
|
|| innermode == BLKmode || outermode == BLKmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op) != innermode
|
|
|
|
|
&& GET_MODE (op) != VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (byte % GET_MODE_SIZE (outermode)
|
|
|
|
|
|| byte >= GET_MODE_SIZE (innermode))
|
|
|
|
|
abort ();
|
|
|
|
|
|
2001-05-17 23:21:21 +02:00
|
|
|
|
if (outermode == innermode && !byte)
|
|
|
|
|
return op;
|
|
|
|
|
|
2001-05-17 17:00:35 +02:00
|
|
|
|
/* Attempt to simplify constant to non-SUBREG expression. */
|
|
|
|
|
if (CONSTANT_P (op))
|
|
|
|
|
{
|
|
|
|
|
int offset, part;
|
2001-07-10 12:38:10 +02:00
|
|
|
|
unsigned HOST_WIDE_INT val = 0;
|
2001-05-17 17:00:35 +02:00
|
|
|
|
|
2001-07-11 02:52:01 +02:00
|
|
|
|
/* ??? This code is partly redundant with code below, but can handle
|
2001-05-17 17:00:35 +02:00
|
|
|
|
the subregs of floats and similar corner cases.
|
|
|
|
|
Later it we should move all simplification code here and rewrite
|
|
|
|
|
GEN_LOWPART_IF_POSSIBLE, GEN_HIGHPART, OPERAND_SUBWORD and friends
|
|
|
|
|
using SIMPLIFY_SUBREG. */
|
2001-06-04 16:52:14 +02:00
|
|
|
|
if (subreg_lowpart_offset (outermode, innermode) == byte)
|
2001-05-17 17:00:35 +02:00
|
|
|
|
{
|
|
|
|
|
rtx new = gen_lowpart_if_possible (outermode, op);
|
|
|
|
|
if (new)
|
|
|
|
|
return new;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar comment as above apply here. */
|
|
|
|
|
if (GET_MODE_SIZE (outermode) == UNITS_PER_WORD
|
|
|
|
|
&& GET_MODE_SIZE (innermode) > UNITS_PER_WORD
|
|
|
|
|
&& GET_MODE_CLASS (outermode) == MODE_INT)
|
|
|
|
|
{
|
2001-06-04 20:04:36 +02:00
|
|
|
|
rtx new = constant_subword (op,
|
|
|
|
|
(byte / UNITS_PER_WORD),
|
|
|
|
|
innermode);
|
2001-05-17 17:00:35 +02:00
|
|
|
|
if (new)
|
|
|
|
|
return new;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
offset = byte * BITS_PER_UNIT;
|
|
|
|
|
switch (GET_CODE (op))
|
|
|
|
|
{
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
if (GET_MODE (op) != VOIDmode)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* We can't handle this case yet. */
|
|
|
|
|
if (GET_MODE_BITSIZE (outermode) >= HOST_BITS_PER_WIDE_INT)
|
2001-07-10 12:38:10 +02:00
|
|
|
|
return NULL_RTX;
|
2001-05-17 17:00:35 +02:00
|
|
|
|
|
|
|
|
|
part = offset >= HOST_BITS_PER_WIDE_INT;
|
|
|
|
|
if ((BITS_PER_WORD > HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& BYTES_BIG_ENDIAN)
|
|
|
|
|
|| (BITS_PER_WORD <= HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& WORDS_BIG_ENDIAN))
|
|
|
|
|
part = !part;
|
|
|
|
|
val = part ? CONST_DOUBLE_HIGH (op) : CONST_DOUBLE_LOW (op);
|
|
|
|
|
offset %= HOST_BITS_PER_WIDE_INT;
|
|
|
|
|
|
2002-05-09 14:02:29 +02:00
|
|
|
|
/* We've already picked the word we want from a double, so
|
2001-05-17 17:00:35 +02:00
|
|
|
|
pretend this is actually an integer. */
|
|
|
|
|
innermode = mode_for_size (HOST_BITS_PER_WIDE_INT, MODE_INT, 0);
|
|
|
|
|
|
|
|
|
|
/* FALLTHROUGH */
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
if (GET_CODE (op) == CONST_INT)
|
|
|
|
|
val = INTVAL (op);
|
|
|
|
|
|
|
|
|
|
/* We don't handle synthetizing of non-integral constants yet. */
|
|
|
|
|
if (GET_MODE_CLASS (outermode) != MODE_INT)
|
2001-07-10 12:38:10 +02:00
|
|
|
|
return NULL_RTX;
|
2001-05-17 17:00:35 +02:00
|
|
|
|
|
|
|
|
|
if (BYTES_BIG_ENDIAN || WORDS_BIG_ENDIAN)
|
|
|
|
|
{
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
offset = (GET_MODE_BITSIZE (innermode)
|
|
|
|
|
- GET_MODE_BITSIZE (outermode) - offset);
|
|
|
|
|
if (BYTES_BIG_ENDIAN != WORDS_BIG_ENDIAN
|
|
|
|
|
&& GET_MODE_SIZE (outermode) < UNITS_PER_WORD)
|
|
|
|
|
offset = (offset + BITS_PER_WORD - GET_MODE_BITSIZE (outermode)
|
|
|
|
|
- 2 * (offset % BITS_PER_WORD));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (offset >= HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
return ((HOST_WIDE_INT) val < 0) ? constm1_rtx : const0_rtx;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
val >>= offset;
|
|
|
|
|
if (GET_MODE_BITSIZE (outermode) < HOST_BITS_PER_WIDE_INT)
|
|
|
|
|
val = trunc_int_for_mode (val, outermode);
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Changing mode twice with SUBREG => just change it once,
|
|
|
|
|
or not at all if changing back op starting mode. */
|
|
|
|
|
if (GET_CODE (op) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode innermostmode = GET_MODE (SUBREG_REG (op));
|
2001-06-04 20:44:57 +02:00
|
|
|
|
int final_offset = byte + SUBREG_BYTE (op);
|
2001-05-17 17:00:35 +02:00
|
|
|
|
rtx new;
|
|
|
|
|
|
|
|
|
|
if (outermode == innermostmode
|
|
|
|
|
&& byte == 0 && SUBREG_BYTE (op) == 0)
|
|
|
|
|
return SUBREG_REG (op);
|
|
|
|
|
|
2001-06-04 20:44:57 +02:00
|
|
|
|
/* The SUBREG_BYTE represents offset, as if the value were stored
|
|
|
|
|
in memory. Irritating exception is paradoxical subreg, where
|
|
|
|
|
we define SUBREG_BYTE to be 0. On big endian machines, this
|
2001-08-17 23:23:12 +02:00
|
|
|
|
value should be negative. For a moment, undo this exception. */
|
2001-06-04 20:44:57 +02:00
|
|
|
|
if (byte == 0 && GET_MODE_SIZE (innermode) < GET_MODE_SIZE (outermode))
|
2001-05-17 17:00:35 +02:00
|
|
|
|
{
|
2001-06-04 20:44:57 +02:00
|
|
|
|
int difference = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode));
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
final_offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
|
|
|
|
|
if (BYTES_BIG_ENDIAN)
|
|
|
|
|
final_offset += difference % UNITS_PER_WORD;
|
|
|
|
|
}
|
|
|
|
|
if (SUBREG_BYTE (op) == 0
|
|
|
|
|
&& GET_MODE_SIZE (innermostmode) < GET_MODE_SIZE (innermode))
|
|
|
|
|
{
|
|
|
|
|
int difference = (GET_MODE_SIZE (innermostmode) - GET_MODE_SIZE (innermode));
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
final_offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
|
|
|
|
|
if (BYTES_BIG_ENDIAN)
|
|
|
|
|
final_offset += difference % UNITS_PER_WORD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See whether resulting subreg will be paradoxical. */
|
2001-06-08 14:02:24 +02:00
|
|
|
|
if (GET_MODE_SIZE (innermostmode) > GET_MODE_SIZE (outermode))
|
2001-06-04 20:44:57 +02:00
|
|
|
|
{
|
|
|
|
|
/* In nonparadoxical subregs we can't handle negative offsets. */
|
|
|
|
|
if (final_offset < 0)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
/* Bail out in case resulting subreg would be incorrect. */
|
|
|
|
|
if (final_offset % GET_MODE_SIZE (outermode)
|
2001-07-10 12:38:10 +02:00
|
|
|
|
|| (unsigned) final_offset >= GET_MODE_SIZE (innermostmode))
|
|
|
|
|
return NULL_RTX;
|
2001-06-04 20:44:57 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int offset = 0;
|
|
|
|
|
int difference = (GET_MODE_SIZE (innermostmode) - GET_MODE_SIZE (outermode));
|
|
|
|
|
|
|
|
|
|
/* In paradoxical subreg, see if we are still looking on lower part.
|
|
|
|
|
If so, our SUBREG_BYTE will be 0. */
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
offset += (difference / UNITS_PER_WORD) * UNITS_PER_WORD;
|
|
|
|
|
if (BYTES_BIG_ENDIAN)
|
|
|
|
|
offset += difference % UNITS_PER_WORD;
|
|
|
|
|
if (offset == final_offset)
|
|
|
|
|
final_offset = 0;
|
2001-05-17 17:00:35 +02:00
|
|
|
|
else
|
2001-07-10 12:38:10 +02:00
|
|
|
|
return NULL_RTX;
|
2001-05-17 17:00:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Recurse for futher possible simplifications. */
|
2001-05-17 18:18:26 +02:00
|
|
|
|
new = simplify_subreg (outermode, SUBREG_REG (op),
|
|
|
|
|
GET_MODE (SUBREG_REG (op)),
|
2001-05-17 17:00:35 +02:00
|
|
|
|
final_offset);
|
|
|
|
|
if (new)
|
|
|
|
|
return new;
|
2001-05-17 18:18:26 +02:00
|
|
|
|
return gen_rtx_SUBREG (outermode, SUBREG_REG (op), final_offset);
|
2001-05-17 17:00:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* SUBREG of a hard register => just change the register number
|
|
|
|
|
and/or mode. If the hard register is not valid in that mode,
|
|
|
|
|
suppress this simplification. If the hard register is the stack,
|
|
|
|
|
frame, or argument pointer, leave this as a SUBREG. */
|
|
|
|
|
|
2001-05-24 19:48:42 +02:00
|
|
|
|
if (REG_P (op)
|
2001-06-04 16:52:14 +02:00
|
|
|
|
&& (! REG_FUNCTION_VALUE_P (op)
|
|
|
|
|
|| ! rtx_equal_function_value_matters)
|
|
|
|
|
#ifdef CLASS_CANNOT_CHANGE_MODE
|
|
|
|
|
&& ! (CLASS_CANNOT_CHANGE_MODE_P (outermode, innermode)
|
|
|
|
|
&& GET_MODE_CLASS (innermode) != MODE_COMPLEX_INT
|
|
|
|
|
&& GET_MODE_CLASS (innermode) != MODE_COMPLEX_FLOAT
|
|
|
|
|
&& (TEST_HARD_REG_BIT
|
|
|
|
|
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE],
|
|
|
|
|
REGNO (op))))
|
|
|
|
|
#endif
|
2001-05-17 17:00:35 +02:00
|
|
|
|
&& REGNO (op) < FIRST_PSEUDO_REGISTER
|
2001-06-04 16:52:14 +02:00
|
|
|
|
&& ((reload_completed && !frame_pointer_needed)
|
|
|
|
|
|| (REGNO (op) != FRAME_POINTER_REGNUM
|
2001-05-17 17:00:35 +02:00
|
|
|
|
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
|
2001-06-04 16:52:14 +02:00
|
|
|
|
&& REGNO (op) != HARD_FRAME_POINTER_REGNUM
|
2001-05-17 17:00:35 +02:00
|
|
|
|
#endif
|
2001-06-04 16:52:14 +02:00
|
|
|
|
))
|
2001-05-17 17:00:35 +02:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
|
|
|
|
&& REGNO (op) != ARG_POINTER_REGNUM
|
|
|
|
|
#endif
|
|
|
|
|
&& REGNO (op) != STACK_POINTER_REGNUM)
|
|
|
|
|
{
|
|
|
|
|
int final_regno = subreg_hard_regno (gen_rtx_SUBREG (outermode, op, byte),
|
|
|
|
|
0);
|
|
|
|
|
|
2001-06-04 16:52:14 +02:00
|
|
|
|
/* ??? We do allow it if the current REG is not valid for
|
|
|
|
|
its mode. This is a kludge to work around how float/complex
|
|
|
|
|
arguments are passed on 32-bit Sparc and should be fixed. */
|
|
|
|
|
if (HARD_REGNO_MODE_OK (final_regno, outermode)
|
|
|
|
|
|| ! HARD_REGNO_MODE_OK (REGNO (op), innermode))
|
2001-11-14 14:51:10 +01:00
|
|
|
|
{
|
|
|
|
|
rtx x = gen_rtx_REG (outermode, final_regno);
|
|
|
|
|
|
|
|
|
|
/* Propagate original regno. We don't have any way to specify
|
|
|
|
|
the offset inside orignal regno, so do so only for lowpart.
|
|
|
|
|
The information is used only by alias analysis that can not
|
|
|
|
|
grog partial register anyway. */
|
|
|
|
|
|
|
|
|
|
if (subreg_lowpart_offset (outermode, innermode) == byte)
|
|
|
|
|
ORIGINAL_REGNO (x) = ORIGINAL_REGNO (op);
|
|
|
|
|
return x;
|
|
|
|
|
}
|
2001-05-17 17:00:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we have a SUBREG of a register that we are replacing and we are
|
|
|
|
|
replacing it with a MEM, make a new MEM and try replacing the
|
|
|
|
|
SUBREG with it. Don't do this if the MEM has a mode-dependent address
|
|
|
|
|
or if we would be widening it. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) == MEM
|
|
|
|
|
&& ! mode_dependent_address_p (XEXP (op, 0))
|
2001-06-12 17:25:16 +02:00
|
|
|
|
/* Allow splitting of volatile memory references in case we don't
|
|
|
|
|
have instruction to move the whole thing. */
|
|
|
|
|
&& (! MEM_VOLATILE_P (op)
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
|| ! have_insn_for (SET, innermode))
|
2001-05-17 17:00:35 +02:00
|
|
|
|
&& GET_MODE_SIZE (outermode) <= GET_MODE_SIZE (GET_MODE (op)))
|
[multiple changes]
Mon Jul 9 06:41:07 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (adjust_address_nv, replace_equiv_address_nv): New fcns.
(operand_subword): Use them.
(change_address_1): Renamed from change_address; new arg VALIDATE.
* expr.h: Reflect above changes; change_address now macro.
* alias.c (canon_rtx): Use replace_equiv_address_nv instead of
making MEM.
* cselib.c (add_mem_for_addr): Likewise.
* expr.c (protect_from_queue, emit_move_insn_1): Likewise.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (eliminate_regs): Likewise.
* simplify-rtx.c (simplify_replace_rtx): Likewise.
* caller-save.c (setup_save_areas): Use adjust_address_nv instead of
adjust_addess.
* combine.c (make_extraction, simplify_shift_const): Likewise.
(gen_lowpart_for_combine): Likewise.
* cse.c (gen_lowpart_if_possible): Likewise.
* function.c (fixup_var_refs_1, purge_addressof_1): Likewise.
* expr.c (expand_expr, case COMPONENT_REF): Likewise.
* optabs.c (gen_move_insn): Likewise.
* reload1.c (alter_reg): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_anon_union_decl): Likewise.
* recog.c (validate_replace_rtx_1): Likewise.
(expr.h): Include.
* Makefile.in (recog.o): Add $(EXPR_H).
* explow.c (stabilize): Call replace_equiv_address.
* expr.c (move_by_pieces_1, store_by_pieces_2): Likewise.
* final.c (alter_subreg): OFFSET is HOST_WIDE_INT.
2001-07-09 Bo Thorsen <bo@suse.co.uk>
* config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support.
2001-07-09 Neil Booth <neil@daikokuya.demon.co.uk>
* final.c (output_addr_const): Use target opening and
closing parentheses.
* target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN
defaults, add to TARGET_ASM_OUT.
* target.h (struct gcc_target): Add open_paren and close_paren.
* doc/md.texi: Update.
* doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE,
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and
TARGET_ASM_CLOSE_PAREN.
* config/i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN):
Override.
* config/pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN):
Override.
* config/1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove.
* config/a29k/a29k.h: Similarly.
* config/alpha/alpha.h: Similarly.
* config/arc/arc.h: Similarly.
* config/arm/aof.h: Similarly.
* config/arm/aout.h: Similarly.
* config/avr/avr.h: Similarly.
* config/c4x/c4x.h: Similarly.
* config/clipper/clipper.h: Similarly.
* config/convex/convex.h: Similarly.
* config/d30v/d30v.h: Similarly.
* config/dsp16xx/dsp16xx.h: Similarly.
* config/elxsi/elxsi.h: Similarly.
* config/fr30/fr30.h: Similarly.
* config/h8300/h8300.h: Similarly.
* config/i370/i370.h: Similarly.
* config/i386/i386.h: Similarly.
* config/i860/i860.h: Similarly.
* config/i960/i960.h: Similarly.
* config/ia64/ia64.h: Similarly.
* config/m32r/m32r.h: Similarly.
* config/m68hc11/m68hc11.h: Similarly.
* config/m68k/m68k.h: Similarly.
* config/m88k/m88k.h: Similarly.
* config/mcore/mcore.h: Similarly.
* config/mips/mips.h: Similarly.
* config/mn10200/mn10200.h: Similarly.
* config/mn10300/mn10300.h: Similarly.
* config/ns32k/ns32k.h: Similarly.
* config/pa/pa.h: Similarly.
* config/pdp11/pdp11.h: Similarly.
* config/pj/pj.h: Similarly.
* config/romp/romp.h: Similarly.
* config/rs6000/rs6000.h: Similarly.
* config/sh/sh.h: Similarly.
* config/sparc/sparc.h: Similarly.
* config/v850/v850.h: Similarly.
* config/vax/vax.h: Similarly.
* config/we32k/we32k.h: Similarly.
2001-07-09 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/c-tree.texi: Document representation of attributes.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/tm.texi: Update some places for the rename of target to
targetm. Fix typo.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* target.h (struct gcc_target): Add insert_attributes.
* target-def.h (TARGET_INSERT_ATTRIBUTES): Define.
(TARGET_INITIALIZER): Update.
* tree.c, tree.h (default_insert_attributes): New function.
Update comments on other default functions to refer to targetm,
not target.
* doc/tm.texi (INSERT_ATTRIBUTES): Update to document
TARGET_INSERT_ATTRIBUTES.
(SET_DEFAULT_DECL_ATTRIBUTES): Remove.
* c-common.c (decl_attributes): Use targetm.insert_attributes.
Don't use PRAGMA_INSERT_ATTRIBUTES.
* Makefile.in (c-common.o): Depend on $(TARGET_H).
* c-decl.c (start_decl, start_function): Don't call
SET_DEFAULT_DECL_ATTRIBUTES.
* config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define.
* config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't
declare.
* config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define.
(c4x_check_attribute): Avoid modifying attribute list itself.
(c4x_set_default_attributes): Rename to c4x_insert_attributes.
Make static.
* config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define.
* config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't
declare.
* config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define.
(sh_pragma_insert_attributes): Rename to sh_insert_attributes.
Make static.
* config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define.
* config/v850/v850-protos.h (v850_set_default_decl_attr): Don't
declare.
* config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define.
(v850_set_default_decl_attr): Rename to v850_insert_attributes.
Adjust parameters. Make static.
2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk>
* c-common.c (decl_attributes): Only take a single attributes
parameter.
* c-common.h (decl_attributes): Update prototype.
* c-decl.c (start_decl, start_function): Only take a single
attributes parameter. Update calls to decl_attributes.
(finish_struct, finish_enum): Update calls to decl_attributes.
(push_parm_decl): Expect unified list of attributes. Update call
to decl_attributes.
* c-parse.in (fndef, initdcl, notype_initdcl, nested_function,
notype_nested_function, component_declarator,
component_notype_declarator, label): Update calls to
decl_attributes.
(absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute
lists that are passed to push_parm_decl.
* c-tree.h (start_function, start_decl): Update prototypes.
* config/sh/sh-protos.h, config/sh/sh.c
(sh_pragma_insert_attributes): Only take a single attributes
parameter.
* config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise.
* doc/tm.texi (INSERT_ATTRIBUTES): Update.
* objc/objc-act.c (define_decl, generate_objc_symtab_decl,
build_module_descriptor, generate_static_references,
generate_strings, build_selector_translation_table,
generate_descriptor_table, generate_protocols,
generate_ivars_list, generate_dispatch_table,
generate_protocol_list, generate_category,
generate_shared_structures, really_start_method, add_objc_decls,
generate_classref_translation_entry): Update calls to start_decl
and start_function.
(build_tmp_function_decl, start_method_def): Unify attribute lists
that are passed to push_parm_decl.
2001-07-08 Neil Booth <neil@daikokuya.demon.co.uk>
* final.c (no_asm_to_stream): New.
(final_scan_insn): Use target structures for prologue ends
and epilogue starts.
* output.h (no_asm_to_stream): New.
* target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE,
TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New.
(TARGET_ASM_OUT): Update.
* target.h (struct gcc_target): New members function_end_prologue
and function_begin_epilogue.
* config/1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused.
* config/alpha/alpha-protos.h (output_end_prologue): Delete.
* config/alpha/alpha.c (output_end_prologue): Rename to
alpha_output_function_end_prologue. Use in target struct
and make static.
* config/alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete.
* config/ia64/ia64-protos.h (ia64_output_end_prologue): Delete.
* config/ia64/ia64.c (ia64_output_end_prologue): Rename to
ia64_output_function_end_prologue. Use in target struct
and make static.
(ia64_function_prologue, ia64_funciton_epilogue): Rename
mistyped prototypes.
* config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete.
* config/m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue):
Delete.
* config/m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename
an use in target struct, make static.
* config/ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE):
Delete.
2001-07-08 Richard Henderson <rth@redhat.com>
* stmt.c (emit_case_nodes): Convert modes properly in low+high test.
2001-07-08 Richard Henderson <rth@redhat.com>
* config/i386/i386.md: Remove constraints strings from define_split
and define_peephole2 patterns.
(eh_return_si, eh_return_di): Split eh_return_1 for modes.
(eh_return): Use them.
2001-07-08 Richard Henderson <rth@redhat.com>
* doc/tm.texi (Exception Handling): New subnode of Stack and Calling.
Document MD_FALLBACK_FRAME_STATE_FOR.
2001-07-07 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset):
Take into account m68hc11_sp_correction for FRAME_POINTER_REGNUM
elimination.
* config/m68hc11/m68hc11.h (STARTING_FRAME_OFFSET): Use 0.
2001-07-07 Nick Clifton <nickc@cambridge.redhat.com>
* config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Append # to end
of the label inside NAME as opposed to just the end of NAME.
2001-07-07 Neil Booth <neil@daikokuya.demon.co.uk>
* config/alpha/alpha-protos.h (vms_valid_decl_attribute_p): Delete.
* config/alpha/alpha.c (alpha_init_machine_status,
alpha_mark_machine_status, alpha_free_machine_status): Delete.
(TARGET_VALID_DECL_ATTRIBUTE): Define for VMS.
(vms_valid_decl_attribute_p): Make static, conditionally compile.
* config/alpha/alpha.h (VALID_MACHINE_DECL_ATTRIBUTE): Delete.
2001-07-06 Stan Shebs <shebs@apple.com>
* target.h (targetm): Rename global from "target", so as not to
conflict with local variables.
* c-decl.c: Ditto.
* c-typeck.c: Ditto.
* final.c: Ditto.
* tree.c: Ditto.
* cp/decl.c: Ditto.
* cp/decl2.c: Ditto.
* cp/typeck.c: Ditto.
* 1750a/1750a.c: Ditto.
* a29k/a29k.c: Ditto.
* arc/arc.c: Ditto.
* arm/arm.c: Ditto.
* avr/avr.c: Ditto.
* clipper/clipper.c: Ditto.
* convex/convex.c: Ditto.
* d30v/d30v.c: Ditto.
* dsp16xx/dsp16xx.c: Ditto.
* elxsi/elxsi.c: Ditto.
* fr30/fr30.c: Ditto.
* h8300/h8300.c: Ditto.
* i370/i370.c: Ditto.
* i386/i386.c: Ditto.
* i860/i860.c: Ditto.
* i960/i960.c: Ditto.
* ia64/ia64.c: Ditto.
* m32r/m32r.c: Ditto.
* m68hc11/m68hc11.c: Ditto.
* m68k/m68k.c: Ditto.
* m88k/m88k.c: Ditto.
* mips/mips.c: Ditto.
* ns32k/ns32k.c: Ditto.
* pa/pa.c: Ditto.
* pdp11/pdp11.c: Ditto.
* romp/romp.c: Ditto.
* rs6000/rs6000.c: Ditto.
* sh/sh.c: Ditto.
* sparc/sparc.c: Ditto.
* vax/vax.c: Ditto.
* we32k/we32k.c: Ditto.
* doc/tm.texi: Update the manual to match.
2001-07-06 Richard Henderson <rth@redhat.com>
* except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of
DWARF2_UNWIND_INFO not just whether it is defined.
2001-07-06 Diego Novillo <dnovillo@redhat.com>
* combine.c (combine_simplify_rtx): Also recompute 'mode' if the
call to simplify_binary_operation returns a new pattern.
2001-07-06 Roman Lechtchinsky <rl@cs.tu-berlin.de>
* glimits.h (__SHRT_MAX__): New.
(SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX.
(SHRT_MAX): Define in terms of __SHRT_MAX__.
2001-07-06 Jan van Male <jan.vanmale@fenk.wau.nl>
* alias.c (base_alias_check): Cast GET_MODE_UNIT_SIZE to int to
avoid warnings.
2001-07-06 Richard Henderson <rth@redhat.com>
* bitmap.c (bitmap_release_memory): Move adjacent to the
allocation functions.
(bitmap_first_set_bit, bitmap_last_set_bit): Streamline knowing
the implementation. Binary search for the set bit.
(bitmap_union_of_diff): Allocate the temporary on the stack
instead of using xmalloc.
2001-07-06 Richard Henderson <rth@redhat.com>
* genrecog.c (validate_pattern): Warn for constraints in
define_{expand,split,peephole2}. Remove strict_low_part
before looking up match_dup.
2001-07-06 DJ Delorie <dj@redhat.com>
* doc/gcc.texi (Makefile): Rename to be a more general purpose
chapter about various build hints and history. Add section
talking about the various types of native and cross builds.
2001-07-06 Neil Booth <neil@daikokuya.demon.co.uk>
* Makefile.in (final.o): Depend on target.h.
* final.c: Include target.h.
(default_function_pro_epilogue): New.
(final_start_function): Use target structure for function prologues.
(final_end_function): Use target structure for function epilogues.
* fold-const.c (real_hex_to_f): Constify s and p.
* output.h (default_function_pro_epilogue): New.
* real.h (real_hex_to_f): Update prototype.
* target-def.h (TARGET_ASM_FUNCTION_PROLOGUE,
TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New.
(TARGET_INITIALIZER): Update.
* target.h (gcc_target): Add struct asm_out.
* doc/tm.texi: Update.
config:
Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and
TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions
in cpu/cpu.c, or rename old functions consistently. Take
a HOST_WIDE INT not an int as the SIZE parameter. Remove now
redundant macros and prototypes. Make new functions static.
* 1750a/1750a.c: Similarly.
* 1750a/1750a.h: Similarly.
* a29k/a29k-protos.h: Similarly.
* a29k/a29k.c: Similarly.
* a29k/a29k.h: Similarly.
* arc/arc-protos.h: Similarly.
* arc/arc.c: Similarly.
* arc/arc.h: Similarly.
* arm/arm-protos.h: Similarly.
* arm/arm.c: Similarly.
* arm/arm.h: Similarly.
* avr/avr-protos.h: Similarly.
* avr/avr.c: Similarly.
* avr/avr.h: Similarly.
* clipper/clipper-protos.h: Similarly.
* clipper/clipper.c: Similarly.
* clipper/clipper.h: Similarly.
* convex/convex.c: Similarly.
* convex/convex.h: Similarly.
* d30v/d30v-protos.h: Similarly.
* d30v/d30v.c: Similarly.
* d30v/d30v.h: Similarly.
* d30v/d30v.md: Similarly.
* dsp16xx/dsp16xx-protos.h: Similarly.
* dsp16xx/dsp16xx.c: Similarly.
* dsp16xx/dsp16xx.h: Similarly.
* elxsi/elxsi.c: Similarly.
* elxsi/elxsi.h: Similarly.
* fr30/fr30.c: Similarly.
* fr30/fr30.md: Similarly.
* h8300/h8300-protos.h: Similarly.
* h8300/h8300.c: Similarly.
* h8300/h8300.h: Similarly.
* i370/i370-protos.h: Similarly.
* i370/i370.c: Similarly.
* i370/i370.h: Similarly.
* i386/i386.c: Similarly.
* i386/osf1elf.h: Similarly.
* i386/osfrose.h: Similarly.
* i860/i860-protos.h: Similarly.
* i860/i860.c: Similarly.
* i860/i860.h: Similarly.
* i960/i960-protos.h: Similarly.
* i960/i960.c: Similarly.
* i960/i960.h: Similarly.
* ia64/ia64-protos.h: Similarly.
* ia64/ia64.c: Similarly.
* ia64/ia64.h: Similarly.
* m32r/m32r-protos.h: Similarly.
* m32r/m32r.c: Similarly.
* m32r/m32r.h: Similarly.
* m68hc11/m68hc11-protos.h: Similarly.
* m68hc11/m68hc11.c: Similarly.
* m68hc11/m68hc11.h: Similarly.
* m68k/crds.h: Similarly.
* m68k/dpx2.h: Similarly.
* m68k/m68k-protos.h: Similarly.
* m68k/m68k.c: Similarly.
* m68k/m68k.h: Similarly.
* m68k/news.h: Similarly.
* m88k/m88k-protos.h: Similarly.
* m88k/m88k.c: Similarly.
* m88k/m88k.h: Similarly.
* mips/mips-protos.h: Similarly.
* mips/mips.c: Similarly.
* mips/mips.h: Similarly.
* ns32k/merlin.h: Similarly.
* ns32k/ns32k.c: Similarly.
* ns32k/ns32k.h: Similarly.
* ns32k/tek6000.h: Similarly.
* pa/pa-protos.h: Similarly.
* pa/pa.c: Similarly.
* pa/pa.h: Similarly.
* pdp11/2bsd.h: Similarly.
* pdp11/pdp11-protos.h: Similarly.
* pdp11/pdp11.c: Similarly.
* pdp11/pdp11.h: Similarly.
* romp/romp-protos.h: Similarly.
* romp/romp.c: Similarly.
* romp/romp.h: Similarly.
* rs6000/rs6000-protos.h: Similarly.
* rs6000/rs6000.c: Similarly.
* rs6000/rs6000.h: Similarly.
* rs6000/sysv4.h: Similarly.
* sh/sh-protos.h: Similarly.
* sh/sh.c: Similarly.
* sh/sh.h: Similarly.
* sparc/sparc-protos.h: Similarly.
* sparc/sparc.c: Similarly.
* sparc/sparc.h: Similarly.
* vax/vax.c: Similarly.
* vax/vax.h: Similarly.
* vax/vms.h: Similarly.
* we32k/we32k.c: Similarly.
* we32k/we32k.h: Similarly.
Fri Jul 6 11:47:59 2001 Jeffrey A Law (law@cygnus.com)
* basic-block.h (first_insn_after_basic_block_note): Declare.
* flow.c (first_insn_after_basic_block_note): Define. Moved
from...
* ssa.c (first_insn_after_basic_block_note): Remove.
* ssa-dce.c (find_inherently_necessary): Consider BARRIERs
necessary.
(ssa_eliminate_dead_code): Properly update the CFG and PHI
nodes when we find a dead conditional branch. Insert BARRIERs
after any blocks with no successors, but which do not have
any BARRIERs.
2001-07-06 Zack Weinberg <zackw@stanford.edu>
* varray.c (varray_check_failed): Use internal_error.
2001-07-05 Andrew Haley <aph@redhat.com>
* Makefile.in (LIB2_DIVMOD_FUNCS): New.
(LIB2FUNCS): Move divmod functions to LIB2_DIVMOD_FUNCS.
* mklibgcc.in: Compile LIB2_DIVMOD_FUNCS.
2001-07-02 Jason Merrill <jason_merrill@redhat.com>
* dwarf2out.c (mem_loc_descriptor): Only look through a constant pool
reference if the target constant is also a SYMBOL_REF.
2001-07-05 Eric Christopher <echristo@redhat.com>
* config/mips/mips.h (MASK_MIPS3900): Remove.
(MASK_MIPS16,MASK_NO_CHECK_ZERO_DIV,MASK_CHECK_RANGE_DIV,
MASK_UNINIT_CONST_IN_RODATA): Change for 3900 mask removal.
(TARGET_MIPS3900): Change to use mips_arch.
(TARGET_MIPS4000): New.
(TARGET_MIPS4100): New.
(TARGET_MIPS4300): New.
(TARGET_SWITCHES): Change 3900 and 4650 options to NULL.
(SUBTARGET_TARGET_OPTIONS): Add -march. Change help text
for -mipsX.
(GENERATE_BRANCHLIKELY): Move TARGET_MIPS3900.
(ISA_HAS_BRANCHLIKELY): To here.
(CC1_CPU_SPEC): New.
(CC1_SPEC): Use here. Remove 4650 and 3900 options.
(mips_arch_string): Declare.
(mips_arch): Declare.
(TARGET_OPTIONS): Add -march and -mtune.
* config/mips/mips.c (mips_arch_string): New.
(mips_arch): New.
(override_options): Handle -march for codegen and -mtune
for scheduling. Use mips_arch. Move tx39 target default here.
(mips_parse_cpu): Move error message to override_options.
* config/mips/r3900.h (TARGET_DEFAULT): Remove.
* config/mips/mips.md: Use TARGET_MIPS4000 and TARGET_MIPS4300.
* doc/invoke.texi (Option Summary): Add -march and -mtune entries.
(MIPS Options): Ditto. Change mcpu entry to historical text.
2001-07-05 H.J. Lu (hjl@gnu.org)
* config/mips/mips.c (mips_parse_cpu): New function to parse
-march=*/-mcpu=*.
2001-07-05 Jim Wilson <wilson@redhat.com>
* config/ia64/lib1funcs.asm: Revert 2001-07-02 change.
* config/ia64/t-ia64: Likewise.
(LIB1ASMFUNCS): Update comment.
2001-07-05 David Edelsohn <edelsohn@gnu.org>
* doc/install.texi (Install GCC: Binaries): Fix typo.
2001-07-04 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory
reference using the stack pointer, adjust it since we push Y
temporarily.
("*ashrsi3"): Likewise.
("*lshrsi3"): Likewise.
2001-07-05 Stephane Carrez <Stephane.Carrez@worldnet.fr>
* config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address
when -fomit-frame-pointer is used.
2001-07-05 Jeffrey Oldham <oldham@codesourcery.com>
* flow.c: Reverse Jan Hubicka's patch of 02July2001.
(try_redirect_by_replacing_jump): Reverse updating properly the
count and frequency information. Reverse removing cc0 setter.
(forwarder_block_p): Reverse fixing for fallthru blocks.
2001-07-05 DJ Delorie <dj@redhat.com>
* gcc.c (TARGET_OPTION_TRANSLATE_TABLE): New.
(translate_options): If the above is defined, use it to map
given options to new options.
* doc/tm.texi: Document it.
2001-07-05 Brad Lucier <lucier@math.purdue.edu>
Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/invoke.texi (Optimize Options): Document that -fgcse may
cause programs using computed gotos to run more slowly.
2001-07-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi (Specific): Markup, spelling and typo fixes.
Fixed sorting.
Consistently require binutils 2.11.2, not prereleases.
(Specific, decstation-*): Canonicalize as mips-dec-*.
(Specific, i?86-*-sco3.2v5*): Remove make bootstrap requirement,
always necessary.
(Specific, m68k-altos): Removed reference to README.altos, deleted.
(Specific, mips-*): Reword MIPS C compiler requirements.
(Specific, powerpc*-*-*): New, mention --with-cpu once.
(Specific, sunv5): Removed, obsolete.
2001-07-05 Nathan Sidwell <nathan@codesourcery.com>
* dwarf2out.c (output_loc_list): Use an all ones mask for
.text asm output and don't rely on long long
literals. Reformat some long lines.
2001-07-05 Andreas Jaeger <aj@suse.de>
* doc/gcc.texi (GNU/Linux): Remove accidental re-add of GPL
section.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* dwarf2out.c (dwarf2out_define): Update comment.
(dwarf2out_undef): Ditto.
(dwarf2out_start_source_file): Ditto.
(dwarf2out_end_source_file): Ditto.
(dwarf2out_finish): Output DW_MACINFO_end_file for primary file,
since we never call the start/end debug hook for the primary file.
2001-07-04 Kazu Hirata <kazu@hxi.com>
* config/h8300/h8300.c (get_shift_alg): Remove an extra operand
from shll.
2001-07-04 Nathan Sidwell <nathan@codesourcery.com>
* cppinit.c (remove_dup_dirs): Inform if a system include
directory is being reordered.
* doc/invoke.texi (Directory Options): GCC warns if you hide a
system include.
* doc/cpp.texi (Search Paths): Likewise.
* doc/gcc.texi (Interoperation): Remove information about
-I/usr/include.
2001-07-04 Nathan Sidwell <nathan@codesourcery.com>
* varray.h (VARRAY_TOP_GENERIC_PTR): Remove spurious parameter.
(VARRAY_TOP_CHAR_PTR): Likewise.
2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.c (process_command): Don't assign elements of a const char*.
Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (change_address): Don't abort if invalid address while
reload is in progress.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* c-lex.c (cb_file_change): Pass line number to
debug_start_source_file.
(cb_undefine): Pass correct line number to debug_undef.
* toplev.c (debug_start_source_file): Add line number to
parameters. Pass it along to dwarf2out_start_source_file.
(decode_g_option): Stop resetting debug level back to normal when
we change debug formats, unless the current level is
none. (Before, -g3 -gdwarf-2 would use debug level 2, rather than
3).
* toplev.h (debug_start_source_file): Add line number to
parameters.
* dwarf2out.h (dwarf2out_start_source_file): Add line number to
parameters.
* dwarf2out.c (dwarf2out_start_source_file): Add line number to
parameters.
Output debug_macinfo data for starting file if requested.
(dwarf2out_end_source_file): Output debug_macinfo data for ending
file if requested.
(dwarf2out_define): Output debug_macinfo data for defining a macro
if requested.
(dwarf2out_undef): Output debug_macinfo data for undefining a
macro if requested.
(DEBUG_MACINFO_SECTION): New. DWARF2 macro info section name.
(DEBUG_MACINFO_SECTION_LABEL): New. DWARF2 macro info section label.
(macinfo_section_label): New. DWARF2 macro info section label.
(dwarf2out_init): If we want macro info, output the start label
for the section.
(dwarf2out_finish): If we want macro info, add a DW_AT_macro_info
attribute to the compilation unit die pointing to the macro info.
2001-07-04 Daniel Berlin <dan@cgsoftware.com>
* dwarf2out.c (new_loc_list): Move to inside #ifdef
DWARF2_DEBUGGING_INFO.
(add_loc_descr_to_loc_list): Ditto.
(output_loc_list): Ditto.
Also, fix thinko in curr not being initialized.
(gen_internal_sym): Ditto.
Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (replace_equiv_address): New function.
* expr.h (replace_equiv_address): New declaration.
* explow.c (validize_mem): Call it instead of change_address and
also call if -fforce-addr and address is constant.
* expr.c: Replace more calls to change_address with adjust_address
and/or replace_equiv_address or to validize_mem.
* function.c, regmove.c, config/alpha/alpha.c: Likewise.
* config/arm/arm.md, config/clipper/clipper.md: Likewise.
* config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise.
* config/i370/i370.md, config/i860/i860.md: Likewise.
* config/i960/i960.md, config/mips/mips.c: Likewise.
* config/mips/mips.md, config/pa/pa.md: Likewise.
* config/pdp11/pdp11.md, config/rs6000/rs6000.c: Likewise.
* config/rs6000/rs6000.md, config/sh/sh.md: Likewise.
2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA.
* bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a
function.
2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/include: New directory.
* doc/fdl.texi: Move to doc/include/fdl.texi.
* doc/texinfo.tex: Move to doc/include/texinfo.tex.
* doc/include/funding.texi, doc/include/gpl.texi: New files.
* doc/gcc.texi: Use funding.texi and gpl.texi.
* Makefile.in ($(docdir)/cpp.info, $(docdir)/gcc.info,
$(docdir)/cppinternals.info, cpp.dvi. gcc.dvi. cppinternals.dvi):
Update dependencies and use -I $(docdir)/include.
2001-07-04 Anthony Green <green@redhat.com>
* config/v850/t-v850 (v850-c.o): Add missing dependencies.
2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi (sparc64-*-*): Remove garbage.
Wed Jul 4 09:07:44 2001 Jan van Male <jan.vanmale@fenk.wau.nl>
* i386.c (ix86_expand_builtin, case IX86_BUILTIN_SETPS):
Fix typo in last change to use adjust_address.
2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi (Specific): Update information for *-*-solaris*.
Tue Jul 3 22:33:15 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide): Reinitialize Y for restart.
2001-07-03 Stan Shebs <shebs@apple.com>
* config/darwin.h (SECTION_FUNCTION): Remove WAS_TEXT argument, remove
case for flag_no_mach_text_sections.
(EXTRA_SECTION_FUNCTIONS): Remove arg from uses of SECTION_FUNCTION.
* config/darwin.c (flag_no_mach_text_sections): Remove.
* config/darwin-protos.h (darwin_init_pragma): Remove decl.
Tue Jul 3 15:35:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide, case PLUS): Call find_constant_term
and avoid checking for constant as first operand.
* recog.c (find_constant_term_loc): No longer static.
(adj_offettable_operand): Delete.
* rtl.h (adj_offsettable_operand): Delete declaration.
(find_constant_term): Add declaration.
* caller-save.c: Replace calls to adj_offsettable_operand with calls
to adjust_address.
* config/arm/arm.c, config/c4x/c4x.c: Likewise.
* config/clipper/clipper.md, config/h8300/h8300.c: Likewise.
* config/i386/i386.c, config/i386/i386.md: Likewise.
* config/i860/i860.c, config/i960/i960.c: Likewise.
* config/i960/i960.md, config/m68hc11/m68hc11.c: Likewise.
* config/m68k/m68k.c, config/m68k/m68k.md: Likewise.
* config/m88k/m88k.md, config/mcore/mcore.c: Likewise.
* config/mips/mips.c, config/mips/mips.md: Likewise.
* config/mn10200/mn10200.c, config/mn10300/mn10300.c: Likewise.
* config/ns32k/ns32k.c, config/ns32k/ns32k.md: Likewise.
* config/pa/pa.c, config/pdp11/pdp11.c: Likewise.
* config/pdp11/pdp11.md, config/sh/sh.c, config/v850/v850.c: Likewise.
* config/vax/vax.md, config/ns32k/ns32k.c: Likewise.
* config/ns32k/ns32k.md: Likewise.
2001-07-03 Zack Weinberg <zackw@stanford.edu>
* rtl.c (copy_rtx): Handle 'T' format letter.
* gensupport.c (collect_insn_data): Likewise.
* print-rtl.c (print_rtx): Print 'T' slots like 's'.
2001-07-03 Nick Clifton <nickc@cambridge.redhat.com>
* doc/invoke.texi (Directory Options): Specifiy range for <N> in
-B option. Use 'dir' not 'foo' as example directory name.
2001-07-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define.
Fixes PRs bootstrap/3067, bootstrap/3249, bootstrap/3275.
2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/cppinternals.texi: Improve formatting and logical markup.
2001-07-03 Andreas Jaeger <aj@suse.de>
* Makefile.in (insn-recog.o): Add dependency on reload.h.
* genrecog.c (write_header): Include reload.h for prototypes in
insn-recog.c.
2001-07-03 Neil Booth <neil@daikokuya.demon.co.uk>
config:
* i386/cygwin.h (VALID_MACHINE_DECL_ATTRIBUTE,
VALID_MACHINE_TYPE_ATTRIBUTE): Remove.
* i386/i386-protos.h (i386_pe_valid_decl_attribute_p,
i386_pe_valid_type_attribute_p): Add.
* i386/i386.c (TARGET_INITIALIZER): Override for cygwin targets.
* i386/winnt.c (i386_valid_decl_attribute_p): Return directly.
Mon Jul 2 21:52:19 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* explow.c (plus_constant_wide, case LO_SUM): New case.
(plus_constant_for_output_wide): Delete.
* rtl.h (plus_constant_for_output): Delete.
* alias.c (canon_rtx, init_alias_analysis): Call plus_constant
instead of plus_constant_for_output.
* recog.c (offsettable_address_p, adj_offsettable_operand): Likewise.
* config/darwin.c, config/arm/arm.c, config/m68k/m68k.c: Likewise.
* config/m88k/m88k.c, config/mips/mips.c, config/pa/pa.c: Likewise.
* config/rs6000/rs6000.c, config/sparc/sparc.c: Likewise.
* config/sparc/sparc.md: Likewise.
Convert some change_address calls to adjust_address.
2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk>
* doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi,
doc/rtl.texi, doc/tm.texi: Improve formatting. Improve
documentation of -std and -Wwrite-strings.
2001-07-02 Geoffrey Keating <geoffk@redhat.com>
* cse.c (canon_hash): Don't register registers in very small
register classes, as extending their lifetime might cause
reload to fail.
Mon Jul 2 23:14:00 CEST 2001 Jan Hubicka <jh@suse.cz>
* flow.c (try_redirect_by_replacing_jump): Remove cc0 setter.
* flow.c (forwarder_block_p): Fix for fallthru blocks.
(try_redirect_by_replacing_jump): Update properly the count
and frequency information.
Mon Jul 2 14:20:13 2001 Jeffrey A Law (law@cygnus.com)
* toplev.c (dump_file_index): Move SSA dumps just after first
jump dump.
(dump_file): Corresponding changes.
(rest_of_compilation): Move SSA path to just after the first
jump pass.
* doc/gcc.texi (Passes): Update due to movement of SSA path.
* doc/invoke.texi: Update dump file #s as they were completely
out of date with reality.
2001-07-02 Geoffrey Keating <geoffk@redhat.com>
* doc/tm.texi (Frame Layout): Document STACK_PUSH_CODE.
* expr.c (emit_move_insn_1): Deal with non-default
STACK_PUSH_CODE.
* expr.c (emit_single_push_insn): Fix warning.
2001-07-02 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com>
* expr.c (emit_move_insn_1): Avoid modifying
cfun->expr->x_stack_pointer when PUSH_ROUNDING is defined.
Mon Jul 2 15:33:31 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* emit-rtl.c (adjust_address): New function.
* expr.h (adjust_address): Add declaration.
* builtins.c: Replace some calls to change_address with calls to it
or to validize_mem.
* caller-save.c, dwarf2out.c, except.c, expmed.c, expr.c: Likewise.
* function.c, config/a29k/a29k.md, config/alpha/alpha.c: Likewise.
* config/arm/arm.c, config/convex/convex.c: Likewise.
* config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise.
* config/i386/i386.c, config/i386/i386.md: Likewise.
* config/ia64/ia64.c, config/ia64/ia64.md: Likewise.
* config/m32r/m32r.c, config/m68k/m68k.md: Likewise.
* config/m88k/m88k.c, config/mips/mips.md: Likewise.
* config/ns32k/ns32k.c, config/rs6000/rs6000.c: Likewise.
* config/sh/sh.c, config/sparc/sparc.md: Likewise.
2001-07-02 Jim Wilson <wilson@redhat.com>
* config/ia64/ia64.h: Delete obsolete lib1funcs.asm comment.
2001-07-02 Steve Ellcey <sje@cup.hp.com>
* config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore.
* config/ia64/lib1funcs.asm: Change macro names to match t-ia64.
2001-07-02 Zack Weinberg <zackw@stanford.edu>
* cppinit.c (lang_defaults): New table.
(set_lang): Just read from lang_defaults into the live options
structure.
2001-07-02 Zack Weinberg <zackw@stanford.edu>
* Makefile.in (doc): Depend on $(GENERATED_MANPAGES).
* doc/.cvsignore: Add gcc.1, cpp.1, gcov.1.
* doc/gcc.1, doc/cpp.1, doc/gcov.1: Removed.
2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi: Various spelling and markup fixes.
(Installing GCC): Component specific installation instructions are
gone.
Fix reference.
Warn about removing old install dir in the presence of shared libs.
(Configuration): Invoke with options target to match configure
--help.
Consistently refer to gas, gld pathnames.
Invert --enable-multilib documentation.
Remove references to old compiler versions.
Mon Jul 2 12:50:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* flow.c (try_simplify_condjump): Fix typo in updating fallthru flags.
2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* doc/install.texi (Specific, mips*-sgi-irix4): Split from IRIX 5
section.
(Specific, mips*-sgi-irix5): Note IDO download.
Reworded MIPS C hints.
Use GNU as instead of GAS.
Markup fixes.
Removed SGI Freeware reference, IRIX 6 only.
(Specific, mips*-sgi-irix6): Removed ranlib caveats, obsolete.
Note N64 library requirement/workaround.
Update O32 hints.
Complete list of structure passing bug victims.
2001-07-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at>
* doc/install.texi: Remove CVS Id.
2001-07-02 Andreas Jaeger <aj@suse.de>
* ssa-dce.c (note_inherently_necessary_set): Add unused attribute.
(find_inherently_necessary): Remove unused variable.
2001-07-02 Nathan Sidwell <nathan@codesourcery.com>
* c-common.h (TDI_inlined): New ast dump phase.
(dump_flag_name): New function.
* c-dump.c (dump_files): Add inlined phase.
(dump_flag_name): Define.
* doc/invoke.texi (-fdump-ast-inlined): Document.
Mon Jul 2 06:29:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c (layout_decl): Revert change to handling of alignment
in packed types.
Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* c-common.c (decl_attributes, case A_MODE): Don't call layout_decl
for FIELD_DECL.
2001-07-01 Geoffrey Keating <geoffk@redhat.com>
* doc/tm.texi (FUNCTION_ARG): Document that the last call
is special.
2001-07-01 Nathan Sidwell <nathan@codesourcery.com>
* tlink.c (recompile_files): Remove COMPILER_PATH and
LIBRARY_PATH from the environment.
2001-07-01 Zack Weinberg <zackw@stanford.edu>
* c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT,
RID_LAST_PQ. Move RID_FIRST_PQ down with the other FIRST/LAST
enumerators.
(OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros.
* c-parse.in (OBJC_STRING): Kill.
(objc_string): Decompose to [objc_string] '@' STRING.
(reswords): Take the leading '@' off all the Objective C keywords.
(objc_rid_sans_at): Kill.
(init_reswords): Don't initialize it.
(yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD.
(_yylex): Kill reconsider label. Look ahead one token after
an '@'; if we get an identifier, check whether it's an
Objective C @-keyword. If so, return the keyword. Otherwise,
put back the token and return the '@' as a terminal.
* cpplib.c (lex_macro_node): Remove unnecessary check for
leading '@' on identifier. Clarify control flow and commentary.
Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* cse.c (new_label_ref): Variable deleted.
(insert): Remove set of new_label_ref.
(check_for_label_ref): New function.
(cse_basic_block): Don't check new_label_ref; call check_for_label_ref.
See ChangeLog.5 for earlier changes.
From-SVN: r43861
2001-07-09 13:20:51 +02:00
|
|
|
|
return adjust_address_nv (op, outermode, byte);
|
2001-05-17 23:21:21 +02:00
|
|
|
|
|
|
|
|
|
/* Handle complex values represented as CONCAT
|
|
|
|
|
of real and imaginary part. */
|
|
|
|
|
if (GET_CODE (op) == CONCAT)
|
|
|
|
|
{
|
2001-06-11 11:30:50 +02:00
|
|
|
|
int is_realpart = byte < GET_MODE_UNIT_SIZE (innermode);
|
2001-05-17 23:21:21 +02:00
|
|
|
|
rtx part = is_realpart ? XEXP (op, 0) : XEXP (op, 1);
|
|
|
|
|
unsigned int final_offset;
|
2001-06-29 23:15:01 +02:00
|
|
|
|
rtx res;
|
2001-05-17 23:21:21 +02:00
|
|
|
|
|
2001-06-11 11:30:50 +02:00
|
|
|
|
final_offset = byte % (GET_MODE_UNIT_SIZE (innermode));
|
2001-06-29 23:15:01 +02:00
|
|
|
|
res = simplify_subreg (outermode, part, GET_MODE (part), final_offset);
|
|
|
|
|
if (res)
|
|
|
|
|
return res;
|
ChangeLog.2, [...]: Fix spelling errors and typos.
* ChangeLog.2, ChangeLog.3, ChangeLog.4, FSFChangeLog.10,
FSFChangeLog.11, c-common.c, c-common.def, c-common.h, c-decl.c,
c-dump.c, c-typeck.c, except.c, sdbout.c, simplify-rtx.c,
timevar.h, tree.h, varasm.c: Fix spelling errors and typos.
From-SVN: r46621
2001-10-30 00:01:45 +01:00
|
|
|
|
/* We can at least simplify it by referring directly to the relevant part. */
|
2001-06-29 23:15:01 +02:00
|
|
|
|
return gen_rtx_SUBREG (outermode, part, final_offset);
|
2001-05-17 23:21:21 +02:00
|
|
|
|
}
|
|
|
|
|
|
2001-05-17 17:00:35 +02:00
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
2001-05-17 20:46:58 +02:00
|
|
|
|
/* Make a SUBREG operation or equivalent if it folds. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
simplify_gen_subreg (outermode, op, innermode, byte)
|
|
|
|
|
rtx op;
|
|
|
|
|
unsigned int byte;
|
|
|
|
|
enum machine_mode outermode, innermode;
|
|
|
|
|
{
|
|
|
|
|
rtx new;
|
|
|
|
|
/* Little bit of sanity checking. */
|
|
|
|
|
if (innermode == VOIDmode || outermode == VOIDmode
|
|
|
|
|
|| innermode == BLKmode || outermode == BLKmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op) != innermode
|
|
|
|
|
&& GET_MODE (op) != VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (byte % GET_MODE_SIZE (outermode)
|
|
|
|
|
|| byte >= GET_MODE_SIZE (innermode))
|
|
|
|
|
abort ();
|
|
|
|
|
|
2001-07-11 11:41:34 +02:00
|
|
|
|
if (GET_CODE (op) == QUEUED)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
2001-05-17 20:46:58 +02:00
|
|
|
|
new = simplify_subreg (outermode, op, innermode, byte);
|
|
|
|
|
if (new)
|
|
|
|
|
return new;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) == SUBREG || GET_MODE (op) == VOIDmode)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
return gen_rtx_SUBREG (outermode, op, byte);
|
|
|
|
|
}
|
1999-11-01 01:18:23 +01:00
|
|
|
|
/* Simplify X, an rtx expression.
|
|
|
|
|
|
|
|
|
|
Return the simplified expression or NULL if no simplifications
|
|
|
|
|
were possible.
|
|
|
|
|
|
|
|
|
|
This is the preferred entry point into the simplification routines;
|
|
|
|
|
however, we still allow passes to call the more specific routines.
|
|
|
|
|
|
|
|
|
|
Right now GCC has three (yes, three) major bodies of RTL simplficiation
|
|
|
|
|
code that need to be unified.
|
|
|
|
|
|
|
|
|
|
1. fold_rtx in cse.c. This code uses various CSE specific
|
|
|
|
|
information to aid in RTL simplification.
|
|
|
|
|
|
|
|
|
|
2. simplify_rtx in combine.c. Similar to fold_rtx, except that
|
|
|
|
|
it uses combine specific information to aid in RTL
|
|
|
|
|
simplification.
|
|
|
|
|
|
|
|
|
|
3. The routines in this file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Long term we want to only have one body of simplification code; to
|
|
|
|
|
get to that state I recommend the following steps:
|
|
|
|
|
|
|
|
|
|
1. Pour over fold_rtx & simplify_rtx and move any simplifications
|
|
|
|
|
which are not pass dependent state into these routines.
|
|
|
|
|
|
|
|
|
|
2. As code is moved by #1, change fold_rtx & simplify_rtx to
|
|
|
|
|
use this routine whenever possible.
|
|
|
|
|
|
|
|
|
|
3. Allow for pass dependent state to be provided to these
|
|
|
|
|
routines and add simplifications based on the pass dependent
|
|
|
|
|
state. Remove code from cse.c & combine.c that becomes
|
|
|
|
|
redundant/dead.
|
|
|
|
|
|
|
|
|
|
It will take time, but ultimately the compiler will be easier to
|
|
|
|
|
maintain and improve. It's totally silly that when we add a
|
|
|
|
|
simplification that it needs to be added to 4 places (3 for RTL
|
|
|
|
|
simplification and 1 for tree simplification. */
|
2002-05-09 14:02:29 +02:00
|
|
|
|
|
1999-11-01 01:18:23 +01:00
|
|
|
|
rtx
|
|
|
|
|
simplify_rtx (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
2001-02-13 21:43:13 +01:00
|
|
|
|
enum rtx_code code = GET_CODE (x);
|
|
|
|
|
enum machine_mode mode = GET_MODE (x);
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
switch (GET_RTX_CLASS (code))
|
|
|
|
|
{
|
|
|
|
|
case '1':
|
|
|
|
|
return simplify_unary_operation (code, mode,
|
|
|
|
|
XEXP (x, 0), GET_MODE (XEXP (x, 0)));
|
|
|
|
|
case 'c':
|
2001-07-02 17:43:38 +02:00
|
|
|
|
if (swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
|
2001-06-28 02:14:23 +02:00
|
|
|
|
{
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
tem = XEXP (x, 0);
|
|
|
|
|
XEXP (x, 0) = XEXP (x, 1);
|
|
|
|
|
XEXP (x, 1) = tem;
|
|
|
|
|
return simplify_binary_operation (code, mode,
|
|
|
|
|
XEXP (x, 0), XEXP (x, 1));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case '2':
|
1999-11-01 01:18:23 +01:00
|
|
|
|
return simplify_binary_operation (code, mode, XEXP (x, 0), XEXP (x, 1));
|
|
|
|
|
|
|
|
|
|
case '3':
|
|
|
|
|
case 'b':
|
|
|
|
|
return simplify_ternary_operation (code, mode, GET_MODE (XEXP (x, 0)),
|
2001-02-13 21:43:13 +01:00
|
|
|
|
XEXP (x, 0), XEXP (x, 1),
|
|
|
|
|
XEXP (x, 2));
|
1999-11-01 01:18:23 +01:00
|
|
|
|
|
|
|
|
|
case '<':
|
2000-08-23 09:59:06 +02:00
|
|
|
|
return simplify_relational_operation (code,
|
2001-02-13 21:43:13 +01:00
|
|
|
|
((GET_MODE (XEXP (x, 0))
|
|
|
|
|
!= VOIDmode)
|
2000-08-23 09:59:06 +02:00
|
|
|
|
? GET_MODE (XEXP (x, 0))
|
|
|
|
|
: GET_MODE (XEXP (x, 1))),
|
1999-11-01 01:18:23 +01:00
|
|
|
|
XEXP (x, 0), XEXP (x, 1));
|
2001-05-17 20:46:58 +02:00
|
|
|
|
case 'x':
|
|
|
|
|
/* The only case we try to handle is a SUBREG. */
|
|
|
|
|
if (code == SUBREG)
|
2002-05-09 14:02:29 +02:00
|
|
|
|
return simplify_gen_subreg (mode, SUBREG_REG (x),
|
2001-05-17 20:46:58 +02:00
|
|
|
|
GET_MODE (SUBREG_REG (x)),
|
|
|
|
|
SUBREG_BYTE (x));
|
|
|
|
|
return NULL;
|
1999-11-01 01:18:23 +01:00
|
|
|
|
default:
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|